-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2196 from evidence-dev/bubbleChartStories
Bubble chart stories
- Loading branch information
Showing
9 changed files
with
198 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@evidence-dev/core-components': patch | ||
--- | ||
|
||
added bubblechart stories |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
name: series_demo_source | ||
type: faker | ||
options: | ||
seed: evidence-series-demo | ||
seed: evidence-series-demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ schema: | |
item: int | ||
options: | ||
- min: 1000 | ||
max: 234593 | ||
max: 234593 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ schema: | |
item: int | ||
options: | ||
- min: 1000 | ||
max: 234593 | ||
max: 234593 |
167 changes: 167 additions & 0 deletions
167
packages/ui/core-components/src/lib/unsorted/viz/bubble/BubbleChart.stories.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
<script context="module"> | ||
/** @type {import("@storybook/svelte").Meta}*/ | ||
export const meta = { | ||
title: 'Charts/BubbleChart', | ||
component: BubbleChart, | ||
argTypes: { | ||
series: { | ||
control: 'string' | ||
}, | ||
sort: { | ||
control: 'boolean' | ||
}, | ||
tooltipTitle: { | ||
control: 'text' | ||
}, | ||
emptySet: { | ||
control: 'select', | ||
options: ['pass', 'warn', 'error'] | ||
}, | ||
emptyMessage: { | ||
control: 'text' | ||
}, | ||
xFmt: { | ||
control: 'text' | ||
}, | ||
yFmt: { | ||
control: 'text' | ||
}, | ||
sizeFmt: { | ||
control: 'text' | ||
}, | ||
shape: { | ||
control: 'select', | ||
options: ['circle', 'emptyCircle', 'rect', 'triangle', 'diamond'] | ||
}, | ||
scaleTo: { | ||
control: 'number' | ||
}, | ||
opacity: { | ||
control: 'number' | ||
}, | ||
fillColor: { | ||
control: 'color' | ||
}, | ||
outlineWidth: { | ||
control: 'number' | ||
}, | ||
outlineColor: { | ||
control: 'color' | ||
}, | ||
colorPalette: { | ||
control: 'array' | ||
}, | ||
seriesColors: { | ||
control: 'object' | ||
}, | ||
yLog: { | ||
control: 'boolean' | ||
}, | ||
yLogBase: { | ||
control: 'number' | ||
}, | ||
xAxisTitle: { | ||
control: 'text' | ||
}, | ||
yAxisTitle: { | ||
control: 'text' | ||
}, | ||
xGridlines: { | ||
control: 'boolean' | ||
}, | ||
yGridlines: { | ||
control: 'boolean' | ||
}, | ||
xAxisLabels: { | ||
control: 'boolean' | ||
}, | ||
yAxisLabels: { | ||
control: 'boolean' | ||
}, | ||
xBaseline: { | ||
control: 'boolean' | ||
}, | ||
yBaseline: { | ||
control: 'boolean' | ||
}, | ||
xTickMarks: { | ||
control: 'boolean' | ||
}, | ||
yTickMarks: { | ||
control: 'boolean' | ||
}, | ||
yMin: { | ||
control: 'number' | ||
}, | ||
yMax: { | ||
control: 'number' | ||
}, | ||
title: { | ||
control: 'text' | ||
}, | ||
subtitle: { | ||
control: 'text' | ||
}, | ||
legend: { | ||
control: 'boolean' | ||
}, | ||
chartAreaHeight: { | ||
control: 'number' | ||
}, | ||
renderer: { | ||
control: 'select', | ||
options: ['canvas', 'svg'] | ||
}, | ||
echartsOptions: { | ||
control: 'object' | ||
}, | ||
seriesOptions: { | ||
control: 'object' | ||
}, | ||
printEchartsConfig: { | ||
control: 'boolean' | ||
} | ||
} | ||
}; | ||
const data = Query.create( | ||
'SELECT plane, fare, SUM(fare) as total_sales, SUM(fare) as total_fare FROM flights WHERE plane IN (SELECT DISTINCT plane FROM flights LIMIT 2) GROUP BY plane, fare LIMIT 25', | ||
query | ||
); | ||
</script> | ||
|
||
<script> | ||
import { Story } from '@storybook/addon-svelte-csf'; | ||
import { Query } from '@evidence-dev/sdk/usql'; | ||
import { query } from '@evidence-dev/universal-sql/client-duckdb'; | ||
import BubbleChart from './BubbleChart.svelte'; | ||
</script> | ||
|
||
<Story name="Base" args={{ x: 'fare', y: 'total_fare', size: 'total_sales' }} let:args> | ||
<BubbleChart {data} {...args} /> | ||
</Story> | ||
|
||
<Story | ||
name="Series" | ||
args={{ series: 'plane', x: 'fare', y: 'total_fare', size: 'total_sales' }} | ||
let:args | ||
> | ||
<BubbleChart {data} {...args} /> | ||
</Story> | ||
<Story name="Sort" args={{ sort: false, x: 'fare', y: 'total_fare', size: 'total_sales' }} let:args> | ||
<BubbleChart {data} {...args} /> | ||
</Story> | ||
<Story | ||
name="Empty Set" | ||
args={{ | ||
emptySet: 'warn', | ||
emptyMessage: 'data set is empty', | ||
x: 'fare', | ||
y: 'total_fare', | ||
size: 'total_sales' | ||
}} | ||
let:args | ||
> | ||
{@const emptyData = []} | ||
<BubbleChart data={emptyData} {...args} /> | ||
</Story> |