diff --git a/.changeset/cuddly-peas-do.md b/.changeset/cuddly-peas-do.md new file mode 100644 index 0000000000..443937485b --- /dev/null +++ b/.changeset/cuddly-peas-do.md @@ -0,0 +1,5 @@ +--- +'@evidence-dev/core-components': patch +--- + +series names can be formatted in Area, Bar, Bubble, Line charts and Scatter plot diff --git a/.changeset/fuzzy-radios-march.md b/.changeset/fuzzy-radios-march.md new file mode 100644 index 0000000000..dacb2ad607 --- /dev/null +++ b/.changeset/fuzzy-radios-march.md @@ -0,0 +1,5 @@ +--- +'evidence-vscode': patch +--- + +dont create legacy file on new project diff --git a/.changeset/giant-parrots-push.md b/.changeset/giant-parrots-push.md new file mode 100644 index 0000000000..361b58e8e6 --- /dev/null +++ b/.changeset/giant-parrots-push.md @@ -0,0 +1,5 @@ +--- +'@evidence-dev/sdk': patch +--- + +ignore non-strings in `addBasePath` diff --git a/.changeset/healthy-panthers-attack.md b/.changeset/healthy-panthers-attack.md new file mode 100644 index 0000000000..537a697202 --- /dev/null +++ b/.changeset/healthy-panthers-attack.md @@ -0,0 +1,5 @@ +--- +'@evidence-dev/core-components': patch +--- + +fixed table header chevron layout shift diff --git a/.changeset/selfish-cherries-tie.md b/.changeset/selfish-cherries-tie.md new file mode 100644 index 0000000000..bb1bd824c8 --- /dev/null +++ b/.changeset/selfish-cherries-tie.md @@ -0,0 +1,6 @@ +--- +'@evidence-dev/evidence': patch +'@evidence-dev/core-components': patch +--- + +Upgrade @sveltejs/kit to 2.8.4 diff --git a/.changeset/unlucky-ants-enjoy.md b/.changeset/unlucky-ants-enjoy.md new file mode 100644 index 0000000000..58984ae3c7 --- /dev/null +++ b/.changeset/unlucky-ants-enjoy.md @@ -0,0 +1,5 @@ +--- +'@evidence-dev/evidence': patch +--- + +re-enable logging on dev mode diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..febd9ffca6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +# https://editorconfig.org +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = tab +insert_final_newline = true +trim_trailing_whitespace = true +max_line_length = 100 diff --git a/.github/workflows/changesets.yml b/.github/workflows/changesets.yml index 98492936c5..18429ed489 100644 --- a/.github/workflows/changesets.yml +++ b/.github/workflows/changesets.yml @@ -20,8 +20,6 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - uses: pnpm/action-setup@v4.0.0 - with: - version: 8.6.9 - uses: actions/setup-node@v4 with: node-version: 20 diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml index 5838f39705..dde7d9d13e 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic.yml @@ -16,8 +16,6 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - uses: pnpm/action-setup@v4.0.0 - with: - version: 8.6.9 - uses: actions/setup-node@v4 with: node-version: 20 diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index c8b7030fd1..61f89073d6 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -52,8 +52,6 @@ jobs: - name: Action Setup (pnpm) uses: pnpm/action-setup@v4 - with: - version: 8 - name: Setup Node uses: actions/setup-node@v4 diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index 19a9d73ba1..a984298f46 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -16,8 +16,6 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@v4.0.0 - with: - version: 8.6.9 - name: Set up node uses: actions/setup-node@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e5fe28d23f..ea81e5b9ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,8 +21,6 @@ jobs: # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits fetch-depth: 0 - uses: pnpm/action-setup@v4.0.0 - with: - version: 8.6.9 - name: Setup Node.js uses: actions/setup-node@v4 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0ffbad4707..6727a7be9b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,8 +40,6 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} - uses: pnpm/action-setup@v4.0.0 - with: - version: 8.6.9 - uses: actions/setup-node@v4 with: diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000000..7af24b7ddb --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22.11.0 diff --git a/package.json b/package.json index ab29a0f8a6..856c0b2519 100644 --- a/package.json +++ b/package.json @@ -111,5 +111,6 @@ "dset": ">=3.1.4", "cookie": ">=0.7.1" } - } -} \ No newline at end of file + }, + "packageManager": "pnpm@8.15.9+sha512.499434c9d8fdd1a2794ebf4552b3b25c0a633abcee5bb15e7b5de90f32f47b513aca98cd5cfd001c31f0db454bc3804edccd578501e4ca293a6816166bbd9f81" +} diff --git a/packages/evidence/cli.js b/packages/evidence/cli.js index 54ea862c9e..72c3c07e04 100755 --- a/packages/evidence/cli.js +++ b/packages/evidence/cli.js @@ -35,12 +35,7 @@ const populateTemplate = function () { // - local settings // - telemetry profile // - static folder (mainly to preserve the data directory) - const keepers = new Set([ - 'evidence.settings.json', - '.profile.json', - 'static', - '.evidence-queries' - ]); + const keepers = new Set(['.profile.json', 'static', '.evidence-queries']); fs.readdirSync('./.evidence/template/').forEach((file) => { if (!keepers.has(file)) fs.removeSync(path.join('./.evidence/template/', file)); }); diff --git a/packages/evidence/package.json b/packages/evidence/package.json index 9a3e23cbf6..1871134ea6 100644 --- a/packages/evidence/package.json +++ b/packages/evidence/package.json @@ -33,7 +33,7 @@ "@evidence-dev/component-utilities": "workspace:*", "@evidence-dev/core-components": "workspace:*", "@evidence-dev/tailwind": "workspace:*", - "@sveltejs/kit": "2.5.4", + "@sveltejs/kit": "2.8.4", "svelte": "4.2.19", "vite": "5.4.11" }, @@ -49,7 +49,7 @@ "sade": "^1.8.1" }, "peerDependencies": { - "@sveltejs/kit": "2.5.4", + "@sveltejs/kit": "2.8.4", "autoprefixer": "^10.4.7", "debounce": "^1.2.1", "git-remote-origin-url": "4.0.0", diff --git a/packages/extension/.vscodeignore b/packages/extension/.vscodeignore index e8db33f291..dff8fece5b 100644 --- a/packages/extension/.vscodeignore +++ b/packages/extension/.vscodeignore @@ -6,7 +6,6 @@ node_modules/** template/node_modules/** template/build/** template/.evidence/template/** -!template/.evidence/template/evidence.settings.json data/** src/** diff --git a/packages/extension/package.json b/packages/extension/package.json index 4b7442bdfc..ef03e169e1 100644 --- a/packages/extension/package.json +++ b/packages/extension/package.json @@ -2,7 +2,7 @@ "name": "evidence-vscode", "displayName": "Evidence", "description": "Build polished data products with SQL and Markdown", - "version": "1.5.4", + "version": "1.5.5", "private": true, "engines": { "vscode": "^1.52.0" @@ -541,9 +541,9 @@ "svelte.svelte-vscode" ], "dependencies": { - "@vscode/extension-telemetry": "^0.9.0", + "@vscode/extension-telemetry": "^0.9.8", "@vscode/vsce": "^2.21.1", "js-yaml": "^4.1.0", "tiged": "^2.12.5" } -} +} \ No newline at end of file diff --git a/packages/extension/src/commands/template.ts b/packages/extension/src/commands/template.ts index 601e6bce5b..322c6e427b 100644 --- a/packages/extension/src/commands/template.ts +++ b/packages/extension/src/commands/template.ts @@ -198,17 +198,6 @@ export async function cloneTemplateRepository( message: 'Finished cloning template project.' }); - // degit.json does not seem to be respected by tiged in this case - // add credentials file to .evidence/template/evidence.settings.json if it is using default template, and also delete the degit.json file - if (templateRepositoryUrl === templateProjectUrl) { - let credentialsString = `{"database":"duckdb","credentials":{"filename":"needful_things.duckdb","gitignoreDuckdb":null}}`; - await workspace.fs.writeFile( - Uri.file(`${projectFolderPath}/.evidence/template/evidence.settings.json`), - Buffer.from(credentialsString) - ); - await workspace.fs.delete(Uri.file(`${projectFolderPath}/degit.json`)); - } - // update Evidence project context and status bar updateProjectContext(); diff --git a/packages/lib/component-utilities/src/getSeriesConfig.js b/packages/lib/component-utilities/src/getSeriesConfig.js index c6fa025ef6..2a1e106abf 100644 --- a/packages/lib/component-utilities/src/getSeriesConfig.js +++ b/packages/lib/component-utilities/src/getSeriesConfig.js @@ -1,4 +1,5 @@ import getDistinctValues from './getDistinctValues.js'; +import { fmt } from '@evidence-dev/component-utilities/formatting'; export default function getSeriesConfig( data, @@ -13,7 +14,8 @@ export default function getSeriesConfig( seriesOrder, size = undefined, tooltipTitle = undefined, - y2 = undefined + y2 = undefined, + seriesLabelFmt = undefined ) { function generateTempConfig(seriesData, seriesName, yAxisIndex, baseConfig) { let tempConfig = { @@ -223,5 +225,12 @@ export default function getSeriesConfig( seriesConfig.sort((a, b) => seriesOrder.indexOf(a.name) - seriesOrder.indexOf(b.name)); } + // format series config: + if (seriesLabelFmt) { + seriesConfig.forEach((item) => { + item.name = fmt(item.name, seriesLabelFmt); + }); + } + return seriesConfig; } diff --git a/packages/lib/sdk/src/utils/svelte/addBasePath.js b/packages/lib/sdk/src/utils/svelte/addBasePath.js index 037eb8e56d..a2f58d4257 100644 --- a/packages/lib/sdk/src/utils/svelte/addBasePath.js +++ b/packages/lib/sdk/src/utils/svelte/addBasePath.js @@ -1,7 +1,7 @@ /** * Adjusts a path to include the configured base path * Ignores undefined, and absolute URLs - * @param {string} path + * @param {unknown} path * @param {import("../../configuration/schemas/config.schema.js").EvidenceConfig} config * @example addBasePath('http://localhost:3000/test') // 'http://localhost:3000/test' * @example addBasePath('/test') // '/base/test' @@ -10,7 +10,8 @@ * @returns */ export const addBasePath = (path, config) => { - if (path === undefined) return path; + if (path instanceof String) path = path.toString(); + if (typeof path !== 'string') return path; if (path.startsWith('http')) return path; if (path.startsWith('#')) return path; // ignore hash links if (/^[^/]*:/.test(path)) return path; // ignore other protocols diff --git a/packages/lib/sdk/src/utils/svelte/addBasePath.spec.js b/packages/lib/sdk/src/utils/svelte/addBasePath.spec.js index d7eddf5275..a85b2ec11a 100644 --- a/packages/lib/sdk/src/utils/svelte/addBasePath.spec.js +++ b/packages/lib/sdk/src/utils/svelte/addBasePath.spec.js @@ -65,4 +65,18 @@ describe('addBasePath', () => { basePath = '/base'; expect(addBasePath('/test:123', config)).toBe('/base/test:123'); }); + it('should properly handle String wrapper or non-string values', () => { + basePath = '/base'; + expect(addBasePath(new String('/test'), config)).toBe('/base/test'); + expect(addBasePath(123, config)).toBe(123); + expect(addBasePath(123n, config)).toBe(123n); + expect(addBasePath(true, config)).toBe(true); + expect(addBasePath(Symbol.for('test'), config)).toBe(Symbol.for('test')); + const fn = () => {}; + expect(addBasePath(fn, config)).toBe(fn); + expect(addBasePath(null, config)).toBe(null); + expect(addBasePath(undefined, config)).toBe(undefined); + const obj = {}; + expect(addBasePath(obj, config)).toBe(obj); + }); }); diff --git a/packages/ui/core-components/package.json b/packages/ui/core-components/package.json index 510f891769..a133d4e75c 100644 --- a/packages/ui/core-components/package.json +++ b/packages/ui/core-components/package.json @@ -90,7 +90,7 @@ "@storybook/testing-library": "^0.2.2", "@storybook/theming": "^8.1.3", "@sveltejs/adapter-auto": "3.1.1", - "@sveltejs/kit": "2.5.4", + "@sveltejs/kit": "2.8.4", "@sveltejs/package": "^2.3.1", "@sveltejs/vite-plugin-svelte": "3.0.2", "@types/lodash.debounce": "^4.0.9", diff --git a/packages/ui/core-components/src/lib/unsorted/ui/SortIcon.svelte b/packages/ui/core-components/src/lib/unsorted/ui/SortIcon.svelte index ed9caeaf37..5f5e33cc9e 100644 --- a/packages/ui/core-components/src/lib/unsorted/ui/SortIcon.svelte +++ b/packages/ui/core-components/src/lib/unsorted/ui/SortIcon.svelte @@ -10,7 +10,7 @@ {#if ascending} - + {:else} - + {/if} diff --git a/packages/ui/core-components/src/lib/unsorted/viz/area/Area.svelte b/packages/ui/core-components/src/lib/unsorted/viz/area/Area.svelte index e6dc2027b6..573450d692 100644 --- a/packages/ui/core-components/src/lib/unsorted/viz/area/Area.svelte +++ b/packages/ui/core-components/src/lib/unsorted/viz/area/Area.svelte @@ -65,6 +65,8 @@ } export let showAllLabels = false; export let seriesOrder = undefined; + export let seriesLabelFmt = undefined; + // Prop check. If local props supplied, use those. Otherwise fall back to global props. $: data = $props.data; $: x = $props.x; @@ -156,7 +158,11 @@ name, xMismatch, columnSummary, - seriesOrder + seriesOrder, + undefined, // size (not needed) + undefined, // tooltipTitle (not needed) + undefined, // y2 (not needed) + seriesLabelFmt ); $: config.update((d) => { diff --git a/packages/ui/core-components/src/lib/unsorted/viz/area/AreaChart.stories.svelte b/packages/ui/core-components/src/lib/unsorted/viz/area/AreaChart.stories.svelte index 5e411df9f2..a5b86c5818 100644 --- a/packages/ui/core-components/src/lib/unsorted/viz/area/AreaChart.stories.svelte +++ b/packages/ui/core-components/src/lib/unsorted/viz/area/AreaChart.stories.svelte @@ -276,3 +276,24 @@ LIMIT 200`, {@const data = Query.create(`select * from numeric_series`, query)} + + {@const data = Query.create( + `SELECT 0.1 AS series, 1 AS x, 10 AS y +UNION +SELECT 0.1 AS series, 2 AS x, 20 AS y +UNION +SELECT 0.1 AS series, 3 AS x, 30 AS y +UNION +SELECT 0.5 AS series, 1 AS x, 5 AS y +UNION +SELECT 0.5 AS series, 2 AS x, 15 AS y +UNION +SELECT 0.5 AS series, 3 AS x, 25 AS y`, + query + )} + + diff --git a/packages/ui/core-components/src/lib/unsorted/viz/area/AreaChart.svelte b/packages/ui/core-components/src/lib/unsorted/viz/area/AreaChart.svelte index cd1ee9b84e..33ececc0b3 100644 --- a/packages/ui/core-components/src/lib/unsorted/viz/area/AreaChart.svelte +++ b/packages/ui/core-components/src/lib/unsorted/viz/area/AreaChart.svelte @@ -79,6 +79,7 @@ export let seriesOrder = undefined; export let connectGroup = undefined; + export let seriesLabelFmt = undefined; diff --git a/packages/ui/core-components/src/lib/unsorted/viz/bar/Bar.svelte b/packages/ui/core-components/src/lib/unsorted/viz/bar/Bar.svelte index b91903ba86..d5d8243ae1 100644 --- a/packages/ui/core-components/src/lib/unsorted/viz/bar/Bar.svelte +++ b/packages/ui/core-components/src/lib/unsorted/viz/bar/Bar.svelte @@ -197,6 +197,8 @@ } }; + export let seriesLabelFmt = undefined; + $: seriesConfig = getSeriesConfig( data, x, @@ -210,7 +212,8 @@ seriesOrder, undefined, undefined, - y2 + y2, + seriesLabelFmt ); $: config.update((d) => { diff --git a/packages/ui/core-components/src/lib/unsorted/viz/bar/BarChart.stories.svelte b/packages/ui/core-components/src/lib/unsorted/viz/bar/BarChart.stories.svelte index 7f34d1387a..937f4e989a 100644 --- a/packages/ui/core-components/src/lib/unsorted/viz/bar/BarChart.stories.svelte +++ b/packages/ui/core-components/src/lib/unsorted/viz/bar/BarChart.stories.svelte @@ -85,3 +85,24 @@ {@const data = Query.create(`select * from numeric_series`, query)} + + {@const data = Query.create( + `SELECT 0.1 AS series, 1 AS x, 10 AS y +UNION +SELECT 0.1 AS series, 2 AS x, 20 AS y +UNION +SELECT 0.1 AS series, 3 AS x, 30 AS y +UNION +SELECT 0.5 AS series, 1 AS x, 5 AS y +UNION +SELECT 0.5 AS series, 2 AS x, 15 AS y +UNION +SELECT 0.5 AS series, 3 AS x, 25 AS y`, + query + )} + + diff --git a/packages/ui/core-components/src/lib/unsorted/viz/bar/BarChart.svelte b/packages/ui/core-components/src/lib/unsorted/viz/bar/BarChart.svelte index efbaff6faa..a991ff8161 100644 --- a/packages/ui/core-components/src/lib/unsorted/viz/bar/BarChart.svelte +++ b/packages/ui/core-components/src/lib/unsorted/viz/bar/BarChart.svelte @@ -115,6 +115,8 @@ export let seriesColors = undefined; export let seriesOrder = undefined; export let connectGroup = undefined; + + export let seriesLabelFmt = undefined; diff --git a/packages/ui/core-components/src/lib/unsorted/viz/bubble/Bubble.svelte b/packages/ui/core-components/src/lib/unsorted/viz/bubble/Bubble.svelte index 5f0f93d463..d26dff493a 100644 --- a/packages/ui/core-components/src/lib/unsorted/viz/bubble/Bubble.svelte +++ b/packages/ui/core-components/src/lib/unsorted/viz/bubble/Bubble.svelte @@ -35,6 +35,7 @@ export let useTooltip = false; export let tooltipTitle; export let seriesOrder = undefined; + export let seriesLabelFmt = undefined; let multiSeries; let tooltipOutput; @@ -249,7 +250,9 @@ columnSummary, seriesOrder, size, - tooltipTitle + tooltipTitle, + undefined, // y2 (not needed) + seriesLabelFmt ); $: config.update((d) => { d.series.push(...seriesConfig); diff --git a/packages/ui/core-components/src/lib/unsorted/viz/bubble/BubbleChart.stories.svelte b/packages/ui/core-components/src/lib/unsorted/viz/bubble/BubbleChart.stories.svelte index 36a9b9c5db..5645ee5b39 100644 --- a/packages/ui/core-components/src/lib/unsorted/viz/bubble/BubbleChart.stories.svelte +++ b/packages/ui/core-components/src/lib/unsorted/viz/bubble/BubbleChart.stories.svelte @@ -191,3 +191,30 @@ > + + + {@const data = Query.create( + `SELECT 0.1 AS series, 1 AS x, 10 AS y, 100 AS size +UNION +SELECT 0.1 AS series, 2 AS x, 20 AS y, 200 AS size +UNION +SELECT 0.1 AS series, 3 AS x, 30 AS y, 300 AS size +UNION +SELECT 0.5 AS series, 1 AS x, 5 AS y, 50 AS size +UNION +SELECT 0.5 AS series, 2 AS x, 15 AS y, 150 AS size +UNION +SELECT 0.5 AS series, 3 AS x, 25 AS y, 250 AS size`, + query + )} + + diff --git a/packages/ui/core-components/src/lib/unsorted/viz/bubble/BubbleChart.svelte b/packages/ui/core-components/src/lib/unsorted/viz/bubble/BubbleChart.svelte index 66333bd7fa..25c1afe489 100644 --- a/packages/ui/core-components/src/lib/unsorted/viz/bubble/BubbleChart.svelte +++ b/packages/ui/core-components/src/lib/unsorted/viz/bubble/BubbleChart.svelte @@ -67,6 +67,7 @@ export let seriesOrder = undefined; export let connectGroup = undefined; + export let seriesLabelFmt = undefined; diff --git a/packages/ui/core-components/src/lib/unsorted/viz/core/Chart.stories.svelte b/packages/ui/core-components/src/lib/unsorted/viz/core/Chart.stories.svelte new file mode 100644 index 0000000000..0eccddfa39 --- /dev/null +++ b/packages/ui/core-components/src/lib/unsorted/viz/core/Chart.stories.svelte @@ -0,0 +1,37 @@ + + + + + + {@const data = Query.create( + `SELECT 1 AS x, 5 AS growth, 50 AS size, 0.1 AS seriesA, 0.7 AS seriesB +UNION +SELECT 2 AS x, 10 AS growth, 60 AS size, 0.1 AS seriesA, 0.7 AS seriesB +UNION +SELECT 3 AS x, 20 AS growth, 70 AS size, 0.1 AS seriesA, 0.7 AS seriesB +UNION +SELECT 4 AS x, 30 AS growth, 90 AS size, 0.1 AS seriesA, 0.7 AS seriesB +UNION +SELECT 5 AS x, 40 AS growth, 110 AS size, 0.1 AS seriesA, 0.7 AS seriesB +UNION +SELECT 6 AS x, 50 AS growth, 130 AS size, 0.1 AS seriesA, 0.7 AS seriesB`, + query + )} + + + + + diff --git a/packages/ui/core-components/src/lib/unsorted/viz/core/_Chart.svelte b/packages/ui/core-components/src/lib/unsorted/viz/core/_Chart.svelte index c89f53bb62..f190c62694 100644 --- a/packages/ui/core-components/src/lib/unsorted/viz/core/_Chart.svelte +++ b/packages/ui/core-components/src/lib/unsorted/viz/core/_Chart.svelte @@ -952,9 +952,9 @@ yVal = params[i].value[swapXY ? 0 : 1]; output = output + - `
${params[i].marker} ${ + `
${params[i].marker} ${ params[i].seriesName - } ${formatValue( + }${formatValue( yVal, // Not sure if this will work. Need to check with multi series on both axes // Check if echarts does the order in the same way - y first, then y2 diff --git a/packages/ui/core-components/src/lib/unsorted/viz/line/Line.svelte b/packages/ui/core-components/src/lib/unsorted/viz/line/Line.svelte index bc0ec788ab..269958e99b 100644 --- a/packages/ui/core-components/src/lib/unsorted/viz/line/Line.svelte +++ b/packages/ui/core-components/src/lib/unsorted/viz/line/Line.svelte @@ -76,6 +76,8 @@ */ export let stepPosition = 'end'; export let seriesOrder = undefined; + /** @type {string | undefined} */ + export let seriesLabelFmt = undefined; // Prop check. If local props supplied, use those. Otherwise fall back to global props. $: data = $props.data; @@ -193,7 +195,8 @@ seriesOrder, undefined, undefined, - y2 + y2, + seriesLabelFmt ); $: config.update((d) => { diff --git a/packages/ui/core-components/src/lib/unsorted/viz/line/LineChart.svelte b/packages/ui/core-components/src/lib/unsorted/viz/line/LineChart.svelte index fbca9b66a7..9d85f2f8c1 100644 --- a/packages/ui/core-components/src/lib/unsorted/viz/line/LineChart.svelte +++ b/packages/ui/core-components/src/lib/unsorted/viz/line/LineChart.svelte @@ -97,6 +97,8 @@ export let seriesOrder = undefined; export let connectGroup = undefined; + /** @type {string | undefined} */ + export let seriesLabelFmt = undefined; diff --git a/packages/ui/core-components/src/lib/unsorted/viz/scatter/Scatter.svelte b/packages/ui/core-components/src/lib/unsorted/viz/scatter/Scatter.svelte index 57fd894a6c..d7b71d0615 100644 --- a/packages/ui/core-components/src/lib/unsorted/viz/scatter/Scatter.svelte +++ b/packages/ui/core-components/src/lib/unsorted/viz/scatter/Scatter.svelte @@ -30,6 +30,8 @@ export let useTooltip = false; // if true, will override the default 'axis'-based echarts tooltip. true only for scatter-only charts export let tooltipTitle; export let seriesOrder = undefined; + /** @type {string | undefined} */ + export let seriesLabelFmt = undefined; let multiSeries; let tooltipOutput; @@ -197,7 +199,9 @@ columnSummary, seriesOrder, undefined, - tooltipTitle + tooltipTitle, + undefined, + seriesLabelFmt ); $: config.update((d) => { d.series.push(...seriesConfig); diff --git a/packages/ui/core-components/src/lib/unsorted/viz/scatter/ScatterPlot.stories.svelte b/packages/ui/core-components/src/lib/unsorted/viz/scatter/ScatterPlot.stories.svelte index 54cc498c8b..2cd438a838 100644 --- a/packages/ui/core-components/src/lib/unsorted/viz/scatter/ScatterPlot.stories.svelte +++ b/packages/ui/core-components/src/lib/unsorted/viz/scatter/ScatterPlot.stories.svelte @@ -185,3 +185,53 @@ > + + {@const data = Query.create( + `SELECT 0.1 AS series, 5000 AS advertising_spend, 25000 AS sales +UNION +SELECT 0.1 AS series, 3000 AS advertising_spend, 18000 AS sales +UNION +SELECT 0.1 AS series, 4000 AS advertising_spend, 22000 AS sales +UNION +SELECT 0.25 AS series, 9000 AS advertising_spend, 45000 AS sales +UNION +SELECT 0.3 AS series, 10000 AS advertising_spend, 50000 AS sales +UNION +SELECT 0.25 AS series, 7000 AS advertising_spend, 32000 AS sales +UNION +SELECT 0.1 AS series, 3500 AS advertising_spend, 21000 AS sales +UNION +SELECT 0.1 AS series, 4500 AS advertising_spend, 22000 AS sales +UNION +SELECT 0.3 AS series, 12000 AS advertising_spend, 60000 AS sales +UNION +SELECT 0.25 AS series, 9500 AS advertising_spend, 46000 AS sales +UNION +SELECT 0.1 AS series, 3200 AS advertising_spend, 15000 AS sales +UNION +SELECT 0.3 AS series, 11000 AS advertising_spend, 54000 AS sales +UNION +SELECT 0.25 AS series, 8000 AS advertising_spend, 41000 AS sales +UNION +SELECT 0.1 AS series, 4000 AS advertising_spend, 19000 AS sales +UNION +SELECT 0.3 AS series, 11500 AS advertising_spend, 55000 AS sales +UNION +SELECT 0.25 AS series, 8200 AS advertising_spend, 42000 AS sales +UNION +SELECT 0.1 AS series, 3800 AS advertising_spend, 19000 AS sales +UNION +SELECT 0.3 AS series, 13000 AS advertising_spend, 65000 AS sales; + +`, + query + )} + + diff --git a/packages/ui/core-components/src/lib/unsorted/viz/scatter/ScatterPlot.svelte b/packages/ui/core-components/src/lib/unsorted/viz/scatter/ScatterPlot.svelte index b5c1a57889..cf6b66ddc5 100644 --- a/packages/ui/core-components/src/lib/unsorted/viz/scatter/ScatterPlot.svelte +++ b/packages/ui/core-components/src/lib/unsorted/viz/scatter/ScatterPlot.svelte @@ -66,6 +66,8 @@ export let seriesOrder = undefined; export let connectGroup = undefined; + /** @type {string | undefined} */ + export let seriesLabelFmt = undefined; diff --git a/packages/ui/core-components/src/lib/unsorted/viz/table/DataTable.stories.svelte b/packages/ui/core-components/src/lib/unsorted/viz/table/DataTable.stories.svelte index 38dcab9e3d..c9855a7f1e 100644 --- a/packages/ui/core-components/src/lib/unsorted/viz/table/DataTable.stories.svelte +++ b/packages/ui/core-components/src/lib/unsorted/viz/table/DataTable.stories.svelte @@ -365,3 +365,91 @@

AreaMap Error

+ diff --git a/packages/ui/core-components/src/lib/unsorted/viz/table/TableCell.svelte b/packages/ui/core-components/src/lib/unsorted/viz/table/TableCell.svelte index 2a907819ce..cb9adab436 100644 --- a/packages/ui/core-components/src/lib/unsorted/viz/table/TableCell.svelte +++ b/packages/ui/core-components/src/lib/unsorted/viz/table/TableCell.svelte @@ -23,7 +23,7 @@ role="cell" class="{$$restProps.class || ''} {dataType} {topBorder} whitespace-nowrap overflow-hidden first:pl-[3px] - {compact ? 'text-xs py-[1px] px-[4px]' : 'py-[2px] px-[8px]'} + {compact ? 'text-xs py-[1px] pr-[16.5px]' : 'py-[2px] pl-[6px] pr-[12px]'} " style:text-align={align} style:height diff --git a/packages/ui/core-components/src/lib/unsorted/viz/table/TableHeader.svelte b/packages/ui/core-components/src/lib/unsorted/viz/table/TableHeader.svelte index 3079893d30..4658ad58e1 100644 --- a/packages/ui/core-components/src/lib/unsorted/viz/table/TableHeader.svelte +++ b/packages/ui/core-components/src/lib/unsorted/viz/table/TableHeader.svelte @@ -36,7 +36,7 @@ {#if rowNumbers} {/if} @@ -75,27 +75,39 @@ - {column.title - ? column.title - : formatColumnTitles - ? safeExtractColumn(column, columnSummary).title - : safeExtractColumn(column, columnSummary).id} - {#if sortObj.col === column.id} - - {/if} +
+ + {column.title + ? column.title + : formatColumnTitles + ? safeExtractColumn(column, columnSummary).title + : safeExtractColumn(column, columnSummary).id} + + + {#if sortObj.col === column.id} + + {:else} + + {/if} + +
{/each} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8dc3668560..2287416078 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -785,7 +785,7 @@ importers: version: link:../lib/universal-sql '@sveltejs/adapter-static': specifier: 3.0.1 - version: 3.0.1(@sveltejs/kit@2.5.4) + version: 3.0.1(@sveltejs/kit@2.8.4) autoprefixer: specifier: ^10.4.7 version: 10.4.20(postcss@8.4.49) @@ -839,8 +839,8 @@ importers: specifier: workspace:* version: link:../ui/tailwind '@sveltejs/kit': - specifier: 2.5.4 - version: 2.5.4(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.19)(vite@5.4.11) + specifier: 2.8.4 + version: 2.8.4(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.19)(vite@5.4.11) svelte: specifier: 4.2.19 version: 4.2.19 @@ -851,8 +851,8 @@ importers: packages/extension: dependencies: '@vscode/extension-telemetry': - specifier: ^0.9.0 - version: 0.9.7(tslib@2.8.1) + specifier: ^0.9.8 + version: 0.9.8(tslib@2.8.1) '@vscode/vsce': specifier: ^2.21.1 version: 2.32.0 @@ -1156,7 +1156,7 @@ importers: version: 2.0.2 sveltekit-autoimport: specifier: ^1.7.1 - version: 1.8.1(@sveltejs/kit@2.5.4) + version: 1.8.1(@sveltejs/kit@2.8.4) vite: specifier: 5.4.11 version: 5.4.11(@types/node@20.17.6) @@ -1427,10 +1427,10 @@ importers: version: 8.4.5(storybook@8.4.5) '@sveltejs/adapter-auto': specifier: 3.1.1 - version: 3.1.1(@sveltejs/kit@2.5.4) + version: 3.1.1(@sveltejs/kit@2.8.4) '@sveltejs/kit': - specifier: 2.5.4 - version: 2.5.4(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.19)(vite@5.4.11) + specifier: 2.8.4 + version: 2.8.4(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.19)(vite@5.4.11) '@sveltejs/package': specifier: ^2.3.1 version: 2.3.7(svelte@4.2.19)(typescript@5.4.2) @@ -1638,8 +1638,8 @@ importers: specifier: 2.1.1 version: 2.1.1 '@sveltejs/kit': - specifier: 2.5.4 - version: 2.5.4(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.19)(vite@5.4.11) + specifier: 2.8.4 + version: 2.8.4(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.19)(vite@5.4.11) '@tidyjs/tidy': specifier: 2.5.2 version: 2.5.2 @@ -7526,12 +7526,12 @@ packages: storybook: 8.4.5(prettier@3.3.3) dev: true - /@sveltejs/adapter-auto@3.1.1(@sveltejs/kit@2.5.4): + /@sveltejs/adapter-auto@3.1.1(@sveltejs/kit@2.8.4): resolution: {integrity: sha512-6LeZft2Fo/4HfmLBi5CucMYmgRxgcETweQl/yQoZo/895K3S9YWYN4Sfm/IhwlIpbJp3QNvhKmwCHbsqQNYQpw==} peerDependencies: '@sveltejs/kit': ^2.0.0 dependencies: - '@sveltejs/kit': 2.5.4(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.19)(vite@5.4.11) + '@sveltejs/kit': 2.8.4(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.19)(vite@5.4.11) import-meta-resolve: 4.1.0 dev: true @@ -7541,6 +7541,15 @@ packages: '@sveltejs/kit': ^2.0.0 dependencies: '@sveltejs/kit': 2.5.4(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.19)(vite@5.4.11) + dev: true + + /@sveltejs/adapter-static@3.0.1(@sveltejs/kit@2.8.4): + resolution: {integrity: sha512-6lMvf7xYEJ+oGeR5L8DFJJrowkefTK6ZgA4JiMqoClMkKq0s6yvsd3FZfCFvX1fQ0tpCD7fkuRVHsnUVgsHyNg==} + peerDependencies: + '@sveltejs/kit': ^2.0.0 + dependencies: + '@sveltejs/kit': 2.8.4(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.19)(vite@5.4.11) + dev: false /@sveltejs/kit@2.5.4(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.19)(vite@5.4.11): resolution: {integrity: sha512-eDxK2d4EGzk99QsZNoPXe7jlzA5EGqfcCpUwZ912bhnalsZ2ZsG5wGRthkydupVjYyqdmzEanVKFhLxU2vkPSQ==} @@ -7567,6 +7576,33 @@ packages: svelte: 4.2.19 tiny-glob: 0.2.9 vite: 5.4.11(@types/node@20.11.28) + dev: true + + /@sveltejs/kit@2.8.4(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.19)(vite@5.4.11): + resolution: {integrity: sha512-oDSBHPokbP2iaQlHiEWAkVLsIugsXve8YtABtlyHBUljA63Wgx0UtV8MSOQOGpRft1M+Cd5rzer+0SFlppQwOg==} + engines: {node: '>=18.13'} + hasBin: true + requiresBuild: true + peerDependencies: + '@sveltejs/vite-plugin-svelte': ^3.0.0 || ^4.0.0-next.1 + svelte: ^4.0.0 || ^5.0.0-next.0 + vite: ^5.0.3 + dependencies: + '@sveltejs/vite-plugin-svelte': 3.0.2(svelte@4.2.19)(vite@5.4.11) + '@types/cookie': 0.6.0 + cookie: 1.0.2 + devalue: 5.1.1 + esm-env: 1.1.4 + import-meta-resolve: 4.1.0 + kleur: 4.1.5 + magic-string: 0.30.13 + mrmime: 2.0.0 + sade: 1.8.1 + set-cookie-parser: 2.7.1 + sirv: 3.0.0 + svelte: 4.2.19 + tiny-glob: 0.2.9 + vite: 5.4.11(@types/node@20.11.28) /@sveltejs/package@2.2.7(svelte@4.2.19)(typescript@5.4.2): resolution: {integrity: sha512-/vvmrQO2mMvROdM/iGRHtRn+ValnK9xzB50pqRcX0IvoeVoTq7uhYf+KifrZTluBA+km6AX/WXRXajrgrgbmvw==} @@ -8677,8 +8713,8 @@ packages: loupe: 3.1.2 tinyrainbow: 1.2.0 - /@vscode/extension-telemetry@0.9.7(tslib@2.8.1): - resolution: {integrity: sha512-2GQbcfDUTg0QC1v0HefkHNwYrE5LYKzS3Zb0+uA6Qn1MBDzgiSh23ddOZF/JRqhqBFOG0mE70XslKSGQ5v9KwQ==} + /@vscode/extension-telemetry@0.9.8(tslib@2.8.1): + resolution: {integrity: sha512-7YcKoUvmHlIB8QYCE4FNzt3ErHi9gQPhdCM3ZWtpw1bxPT0I+lMdx52KHlzTNoJzQ2NvMX7HyzyDwBEiMgTrWQ==} engines: {vscode: ^1.75.0} dependencies: '@microsoft/1ds-core-js': 4.3.4(tslib@2.8.1) @@ -9030,6 +9066,7 @@ packages: /aggregate-error@3.1.0: resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} engines: {node: '>=8'} + requiresBuild: true dependencies: clean-stack: 2.2.0 indent-string: 4.0.0 @@ -10718,6 +10755,10 @@ packages: /devalue@4.3.3: resolution: {integrity: sha512-UH8EL6H2ifcY8TbD2QsxwCC/pr5xSwPvv85LrLXVihmHVC3T3YqTCIwnR5ak0yO1KYqlxrPVOA/JVZJYPy2ATg==} + dev: true + + /devalue@5.1.1: + resolution: {integrity: sha512-maua5KUiapvEwiEAe+XnlZ3Rh0GD+qI1J/nb9vrJc3muPXvcF/8gXYTWF76+5DAqHyDUtOIImEuo0YKE9mshVw==} /didyoumean@1.2.2: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} @@ -11008,6 +11049,7 @@ packages: /err-code@2.0.3: resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==} + requiresBuild: true dev: false /error-ex@1.3.2: @@ -12726,6 +12768,7 @@ packages: /humanize-ms@1.2.1: resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} + requiresBuild: true dependencies: ms: 2.1.3 dev: false @@ -16615,6 +16658,7 @@ packages: /retry@0.12.0: resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} engines: {node: '>= 4'} + requiresBuild: true dev: false /retry@0.13.1: @@ -16950,6 +16994,15 @@ packages: '@polka/url': 1.0.0-next.28 mrmime: 2.0.0 totalist: 3.0.1 + dev: true + + /sirv@3.0.0: + resolution: {integrity: sha512-BPwJGUeDaDCHihkORDchNyyTvWFhcusy1XMmhEVTQTwGeybFbp8YEmB+njbPnth1FibULBSBVwCQni25XlCUDg==} + engines: {node: '>=18'} + dependencies: + '@polka/url': 1.0.0-next.28 + mrmime: 2.0.0 + totalist: 3.0.1 /sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} @@ -17720,13 +17773,13 @@ packages: - supports-color dev: true - /sveltekit-autoimport@1.8.1(@sveltejs/kit@2.5.4): + /sveltekit-autoimport@1.8.1(@sveltejs/kit@2.8.4): resolution: {integrity: sha512-MiKOuQMHj39RqolsuiqchPKr1eBLaVsB+tc5pb6kKoOU0/a5rUS3RPUldiTvz0NDtDZp1WMhnb8Mxl5L16vSaQ==} peerDependencies: '@sveltejs/kit': '>=1.0.0' dependencies: '@rollup/pluginutils': 4.2.1 - '@sveltejs/kit': 2.5.4(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.19)(vite@5.4.11) + '@sveltejs/kit': 2.8.4(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.19)(vite@5.4.11) estree-walker: 2.0.2 magic-string: 0.26.7 dev: false diff --git a/sites/docs/pages/components/area-chart/index.md b/sites/docs/pages/components/area-chart/index.md index 04b5b929dd..d1d1fa7ed9 100644 --- a/sites/docs/pages/components/area-chart/index.md +++ b/sites/docs/pages/components/area-chart/index.md @@ -252,6 +252,13 @@ queries: options="Excel-style format | built-in format name | custom format name" defaultValue="-" /> + + +
- + @@ -1192,7 +1192,7 @@ SELECT 'Brazil', 'South America', 1609, 0.032, 0.1375, 0.1007, 0.091, -4.5, 80.2
```svelte - + @@ -1207,7 +1207,6 @@ SELECT 'Brazil', 'South America', 1609, 0.032, 0.1375, 0.1007, 0.091, -4.5, 80.2 ``` - ### Wrap Titles diff --git a/sites/docs/pages/components/line-chart/index.md b/sites/docs/pages/components/line-chart/index.md index 8128eb72b9..9d2c16a8f6 100644 --- a/sites/docs/pages/components/line-chart/index.md +++ b/sites/docs/pages/components/line-chart/index.md @@ -377,6 +377,13 @@ group by all description="Format to use for y2 column(s)" options="Excel-style format | built-in format name | custom format name" /> + +