Skip to content

@graphty/graphty-element / session / rulePath

Function: rulePath() ​

rulePath(path): string

Defined in: graphty-element/src/session/styles/predicate.ts:1600

Write a column key as the shortest text a rule reads back as that column.

A rule reads a bare name as a file column -- minutes is the column data.minutes -- so a data column whose name needs no quotes comes back as that bare name. Anything else (a name with a dot, a hyphen or a space, or a key outside data., such as a run's result) comes back as quotePath writes it, so the rule still names exactly that column.

ts
import { rulePath } from "@graphty/graphty-element/session";

rulePath("data.minutes"); // "minutes"
rulePath("data.min-cut"); // 'data."min-cut"'

Parameters ​

path ​

string

The column key.

Returns ​

string

Expression source naming the same column.