Skip to content

Commit

Permalink
fix: Column scaleColor
Browse files Browse the repository at this point in the history
  • Loading branch information
zachstence committed Feb 19, 2025
1 parent 259b3f3 commit 68ae42b
Show file tree
Hide file tree
Showing 3 changed files with 2,987 additions and 1,121 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,9 @@
$: if (scaleColor) {
console.warn('[Column] scaleColor is deprecated. Use colorScale instead.');
}
$: colorScale = checkDeprecatedColor('Column', 'colorScale', colorScale);
export let colorScale = 'default';
$: colorScaleStore = resolveColorScale(colorScale ?? colorScale);
$: _colorScale = checkDeprecatedColor('Column', 'colorScale', scaleColor ?? colorScale);
$: colorScaleStore = resolveColorScale(_colorScale);
export let scaleColumn = undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,44 @@
<h2>Filtered Data Group By</h2>
<DataTable data={filteredData} title="Flights" groupBy="regulator" groupsOpen="true" />
</Story>

<!-- scaleColor is deprecated but should still work -->
<Story name="Custom scaleColor">
{@const data = Query.create(
`
select 1 as col
union all
select 2
union all
select 3
union all
select 4
union all
select 5
`,
query
)}
<DataTable {data}>
<Column id="col" contentType="colorscale" scaleColor={['red', 'green']} />
</DataTable>
</Story>

<Story name="Custom colorScale">
{@const data = Query.create(
`
select 1 as col
union all
select 2
union all
select 3
union all
select 4
union all
select 5
`,
query
)}
<DataTable {data}>
<Column id="col" contentType="colorscale" colorScale={['red', 'green']} />
</DataTable>
</Story>
Loading

0 comments on commit 68ae42b

Please sign in to comment.