Skip to content

Commit 96c1e2c

Browse files
committed
add missing props
1 parent 7b28ca1 commit 96c1e2c

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

src/wrappers/components/data-vis/line-chart/LinesWrapper.svelte

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,56 @@
385385
.map((el) => el.x),
386386
),
387387
},
388+
{
389+
name: "xFunction",
390+
category: "xScale",
391+
functionElements: {
392+
functionAsString: `function (number) {
393+
return {
394+
"scaleLinear()": scaleLinear(),
395+
"scaleLog()": scaleLog(),
396+
"scaleTime()": scaleTime(),
397+
}[getValue("xScaleType")]
398+
.domain([getValue("xDomainLowerBound"), getValue("xDomainUpperBound")])
399+
.range([
400+
0,
401+
demoScreenWidth - getValue("paddingLeft") - getValue("paddingRight"),
402+
])(number);
403+
});`,
404+
},
405+
},
406+
{
407+
name: "yFunction",
408+
category: "yScale",
409+
functionElements: {
410+
functionAsString: `function (number) {
411+
return {
412+
"scaleLinear()": scaleLinear(),
413+
"scaleLog()": scaleLog(),
414+
"scaleTime()": scaleTime(),
415+
}[getValue("yScaleType")]
416+
.domain([getValue("yDomainLowerBound"), getValue("yDomainUpperBound")])
417+
.range([
418+
getValue("svgHeight") -
419+
getValue("paddingTop") -
420+
getValue("paddingBottom"),
421+
0,
422+
])(number);
423+
});`,
424+
},
425+
},
426+
{
427+
name: "yScaleType",
428+
category: "yScale",
429+
isProp: false,
430+
options: ["scaleLinear()", "scaleLog()", "scaleTime()"],
431+
},
432+
{
433+
name: "xScaleType",
434+
category: "xScale",
435+
isProp: false,
436+
options: ["scaleLinear()", "scaleLog()", "scaleTime()"],
437+
},
388438
]),
389439
);
390440

0 commit comments

Comments
 (0)