diff --git a/src/_components/AnnotationsData.html.svelte b/src/_components/AnnotationsData.html.svelte index 6aa1c97b..4ed9cee3 100644 --- a/src/_components/AnnotationsData.html.svelte +++ b/src/_components/AnnotationsData.html.svelte @@ -3,9 +3,9 @@ Adds text annotations that get their x and y placement using the `xScale` and `yScale`. --> @@ -60,8 +60,8 @@
{getText(d)}
diff --git a/src/_components/Area-D3.svelte b/src/_components/Area-D3.svelte index 59323292..b2568311 100644 --- a/src/_components/Area-D3.svelte +++ b/src/_components/Area-D3.svelte @@ -3,10 +3,10 @@ Generates an SVG area shape using the `area` function from [d3-shape](https://github.com/d3/d3-shape). --> - + diff --git a/src/_components/Area.svelte b/src/_components/Area.svelte index a9be3994..4b870812 100644 --- a/src/_components/Area.svelte +++ b/src/_components/Area.svelte @@ -3,9 +3,9 @@ Generates an SVG area shape. --> - {#each $data as d} - + {#each c.data as d} + {/each} diff --git a/src/_components/Arrows.svelte b/src/_components/Arrows.svelte index c52e2df1..b37eb29d 100644 --- a/src/_components/Arrows.svelte +++ b/src/_components/Arrows.svelte @@ -4,7 +4,8 @@ --> - + - {#each $config.x as label, i} + {#each c.config.x as label, i} {@const thisAngleSlice = angleSlice * i - Math.PI / 2} {#each tickVals as tick, i (tick)} - {@const tickValUnits = $xScale(tick)} + {@const tickValUnits = c.xScale(tick)} {#if baseline === true}
diff --git a/src/_components/AxisX.svelte b/src/_components/AxisX.svelte index e1b70920..d483e396 100644 --- a/src/_components/AxisX.svelte +++ b/src/_components/AxisX.svelte @@ -3,9 +3,9 @@ Generates an SVG x-axis. This component is also configured to detect if your x-scale is an ordinal scale. If so, it will place the markers in the middle of the bandwidth. --> {#each tickVals as tick, i (tick)} {#if baseline === true} - + {/if} - + {#if gridlines === true} - + {/if} {#if tickMarks === true}
{#each tickVals as tick, i (tick)} - {@const tickValUnits = $xScale(tick)} + {@const tickValUnits = c.xScale(tick)} {#if baseline === true}
diff --git a/src/_components/AxisXTop.svelte b/src/_components/AxisXTop.svelte index 981a1a5b..06f8abb9 100644 --- a/src/_components/AxisXTop.svelte +++ b/src/_components/AxisXTop.svelte @@ -3,9 +3,9 @@ Generates an SVG top x-axis. This component is also configured to detect if your x-scale is an ordinal scale. If so, it will place the markers in the middle of the bandwidth. --> {#each tickVals as tick, i (tick)} {#if baseline === true} - + {/if} - + {#if gridlines === true} - + {/if} {#if tickMarks === true}
{#each tickVals as tick, i (tick)} - {@const tickValUnits = $yScale(tick)} + {@const tickValUnits = c.yScale(tick)}
{#if gridlines === true}
diff --git a/src/_components/AxisY.svelte b/src/_components/AxisY.svelte index 3dd2c6d6..ac88e385 100644 --- a/src/_components/AxisY.svelte +++ b/src/_components/AxisY.svelte @@ -3,9 +3,9 @@ Generates an SVG y-axis. This component is also configured to detect if your y-scale is an ordinal scale. If so, it will place the tickMarks in the middle of the bandwidth. --> {#each tickVals as tick (tick)} - {@const tickValPx = $yScale(tick)} - + {@const tickValPx = c.yScale(tick)} + {#if gridlines === true} - + {/if} {#if tickMarks === true} diff --git a/src/_components/AxisYRight.percent-range.html.svelte b/src/_components/AxisYRight.percent-range.html.svelte index 9399a4cc..6bb5b1a2 100644 --- a/src/_components/AxisYRight.percent-range.html.svelte +++ b/src/_components/AxisYRight.percent-range.html.svelte @@ -5,9 +5,9 @@ Although this is marked as a percent-range component, you can also use it with a normal scale with no configuration needed. By default, if you have `percentRange={true}` it will use percentages, otherwise it will use pixels. This makes this component compatible with server-side and client-side rendered charts. Set the `units` prop to either `'%'` or `'px'` to override the default behavior. -->
{#each tickVals as tick, i (tick)} - {@const tickValUnits = $yScale(tick)} + {@const tickValUnits = c.yScale(tick)}
{#if gridlines === true}
{/if} diff --git a/src/_components/AxisYRight.svelte b/src/_components/AxisYRight.svelte index 61f357df..39344991 100644 --- a/src/_components/AxisYRight.svelte +++ b/src/_components/AxisYRight.svelte @@ -3,9 +3,9 @@ Generates an SVG y-axis on the right-hand side of the chart. This component is also configured to detect if your y-scale is an ordinal scale. If so, it will place the markers in the middle of the bandwidth. --> {#each tickVals as tick (tick)} - {@const tickValPx = $yScale(tick)} - + {@const tickValPx = c.yScale(tick)} + {#if gridlines === true} {/if} {#if tickMarks === true} {/if} - {#each $data as d, i} + {#each c.data as d, i} {/each} diff --git a/src/_components/BarStacked.svelte b/src/_components/BarStacked.svelte index 34889abf..fe282910 100644 --- a/src/_components/BarStacked.svelte +++ b/src/_components/BarStacked.svelte @@ -3,27 +3,27 @@ Generates an SVG stacked bar chart and sets the color via an ordinal scale in `zScale`. --> - {#each $data as series} + {#each c.data as series} {#each series as d, i} {/each} {/each} diff --git a/src/_components/Beeswarm.html.svelte b/src/_components/Beeswarm.html.svelte index 7bf3df58..1146f5b0 100644 --- a/src/_components/Beeswarm.html.svelte +++ b/src/_components/Beeswarm.html.svelte @@ -3,9 +3,9 @@ Generates an HTML Beeswarm chart. -->
@@ -75,11 +75,11 @@
{#each circles as d} {#if getTitle} diff --git a/src/_components/BeeswarmForce.html.svelte b/src/_components/BeeswarmForce.html.svelte index 8614ad57..2c8968c1 100644 --- a/src/_components/BeeswarmForce.html.svelte +++ b/src/_components/BeeswarmForce.html.svelte @@ -3,10 +3,11 @@ Generates an HTML Beeswarm chart using a [d3-force simulation](https://github.com/d3/d3-force). -->
- {#each $data as row} - {@const scaledYValue = $yGet(row)} - {@const scaledXValues = $xGet(row)} + {#each c.data as row} + {@const scaledYValue = c.yGet(row)} + {@const scaledXValues = c.xGet(row)}
{/each} diff --git a/src/_components/ClevelandDotPlot.svelte b/src/_components/ClevelandDotPlot.svelte index ed799195..1bb4145a 100644 --- a/src/_components/ClevelandDotPlot.svelte +++ b/src/_components/ClevelandDotPlot.svelte @@ -3,9 +3,9 @@ Generates an SVG Cleveland dot plot, also known as a lollipop-chart. --> - {#each $data as row} - {@const yVal = $yGet(row)} - {@const xVals = $xGet(row)} + {#each c.data as row} + {@const yVal = c.yGet(row)} + {@const xVals = c.xGet(row)} {#each xVals as circleX, i} - + {/each} {/each} diff --git a/src/_components/Column.svelte b/src/_components/Column.svelte index bf3ab67f..aed06eba 100644 --- a/src/_components/Column.svelte +++ b/src/_components/Column.svelte @@ -3,9 +3,9 @@ Generates an SVG column chart. --> - {#each $data as d, i} + {#each c.data as d, i} {@const colHeight = columnHeight(d)} - {@const xGot = $xGet(d)} + {@const xGot = c.xGet(d)} {@const xPos = Array.isArray(xGot) ? xGot[0] : xGot} - {@const colWidth = $xScale.bandwidth ? $xScale.bandwidth() : columnWidth(d)} - {@const yValue = $y(d)} + {@const colWidth = c.xScale.bandwidth ? c.xScale.bandwidth() : columnWidth(d)} + {@const yValue = c.y(d)} {#if showLabels && yValue} - {yValue} + {yValue} {/if} {/each} diff --git a/src/_components/ColumnStacked.svelte b/src/_components/ColumnStacked.svelte index 0b803056..ab32b5a7 100644 --- a/src/_components/ColumnStacked.svelte +++ b/src/_components/ColumnStacked.svelte @@ -3,24 +3,24 @@ Generates an SVG stacked column chart. It uses the z-scale for color assignments and assumes both `xScale` and `zScale` are ordinal scales. It assumes your data is in a [D3 stack format](https://github.com/d3/d3-shape#stack). --> - {#each $data as series, i} + {#each c.data as series, i} {#each series as d} - {@const yVals = $yGet(d)} + {@const yVals = c.yGet(d)} {@const columnHeight = yVals[0] - yVals[1]} {/each} {/each} diff --git a/src/_components/GroupLabels.html.svelte b/src/_components/GroupLabels.html.svelte index 4c13f422..d6ab0336 100644 --- a/src/_components/GroupLabels.html.svelte +++ b/src/_components/GroupLabels.html.svelte @@ -3,10 +3,10 @@ Generates HTML text labels for a nested data structure. It places the label near the y-value of the highest x-valued data point. This is useful for labeling the final point in a multi-series line chart, for example. It expects your data to be an array of objects where each has `values` field that is an array of data objects. It uses the `z` field accessor to pull the text label. --> -{#each $data as group} +{#each c.data as group}
- {cap($z(group))} + {cap(c.z(group))}
{/each} diff --git a/src/_components/Key.html.svelte b/src/_components/Key.html.svelte index 82b1af82..0f1b8c65 100644 --- a/src/_components/Key.html.svelte +++ b/src/_components/Key.html.svelte @@ -3,7 +3,7 @@ Creates a key for ordinal scales on `zScale`. -->
- {#each $zDomain as item} + {#each c.zDomain as item}
{displayName(item)}
diff --git a/src/_components/Labels.html.svelte b/src/_components/Labels.html.svelte index 56f2bb32..9e8c2acd 100644 --- a/src/_components/Labels.html.svelte +++ b/src/_components/Labels.html.svelte @@ -3,9 +3,9 @@ Adds HTML text labels based on a given list. --> - +