@malloydata/render 0.0.405 → 0.0.407

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,13 @@
1
1
  import { RenderPluginFactory, CoreVizPluginInstance } from '../../api/plugin-types';
2
- import { Field, NestField } from '../../data_tree';
2
+ import { NestField } from '../../data_tree';
3
3
  import { BarChartSettings } from './get-bar_chart-settings';
4
4
  import { ChartDisplayConfig } from '../../component/chart/resolve-chart-display';
5
+ import { SyntheticSeriesField } from '../synthetic-series-field';
5
6
  export interface BarChartPluginInstance extends CoreVizPluginInstance<BarChartPluginMetadata> {
6
7
  getTopNSeries?: (maxSeries: number) => (string | number | boolean)[];
7
8
  field: NestField;
8
9
  chartDisplay: ChartDisplayConfig;
9
- syntheticSeriesField?: Field;
10
+ syntheticSeriesField?: SyntheticSeriesField;
10
11
  hasMultipleSeriesFields?: boolean;
11
12
  }
12
13
  interface BarChartPluginMetadata {
@@ -2,4 +2,9 @@ import { VegaChartProps } from '../../component/types';
2
2
  import { Config } from 'vega';
3
3
  import { RenderMetadata } from '../../component/render-result-metadata';
4
4
  import { BarChartPluginInstance } from './bar-chart-plugin';
5
- export declare function generateBarChartVegaSpecV2(metadata: RenderMetadata, plugin: BarChartPluginInstance, vegaConfig?: Config): VegaChartProps;
5
+ /**
6
+ * The slice of the bar chart plugin instance the spec generator reads,
7
+ * narrowed so tests can construct a real, fully typed value.
8
+ */
9
+ export type BarChartSpecInputs = Pick<BarChartPluginInstance, 'getMetadata' | 'field' | 'chartDisplay' | 'getTopNSeries' | 'syntheticSeriesField' | 'hasMultipleSeriesFields'>;
10
+ export declare function generateBarChartVegaSpecV2(metadata: RenderMetadata, plugin: BarChartSpecInputs, vegaConfig?: Config): VegaChartProps;
@@ -15,4 +15,9 @@ export interface LineChartSettings {
15
15
  zeroBaseline: boolean;
16
16
  interactive: boolean;
17
17
  }
18
- export declare function generateLineChartVegaSpecV2(metadata: RenderMetadata, plugin: LineChartPluginInstance, vegaConfig?: Config): VegaChartProps;
18
+ /**
19
+ * The slice of the line chart plugin instance the spec generator reads,
20
+ * narrowed so tests can construct a real, fully typed value.
21
+ */
22
+ export type LineChartSpecInputs = Pick<LineChartPluginInstance, 'getMetadata' | 'field' | 'chartDisplay' | 'getTopNSeries' | 'syntheticSeriesField'>;
23
+ export declare function generateLineChartVegaSpecV2(metadata: RenderMetadata, plugin: LineChartSpecInputs, vegaConfig?: Config): VegaChartProps;
@@ -1,7 +1,8 @@
1
1
  import { RenderPluginFactory, CoreVizPluginInstance } from '../../api/plugin-types';
2
- import { Field, NestField } from '../../data_tree';
2
+ import { NestField } from '../../data_tree';
3
3
  import { LineChartSettings } from './get-line_chart-settings';
4
4
  import { ChartDisplayConfig } from '../../component/chart/resolve-chart-display';
5
+ import { SyntheticSeriesField } from '../synthetic-series-field';
5
6
  interface LineChartPluginMetadata {
6
7
  type: 'line';
7
8
  field: NestField;
@@ -17,7 +18,7 @@ interface LineChartPluginInstance extends CoreVizPluginInstance<LineChartPluginM
17
18
  chartDisplay: ChartDisplayConfig;
18
19
  seriesStats: Map<string, SeriesStats>;
19
20
  getTopNSeries: (maxSeries: number) => (string | number | boolean)[];
20
- syntheticSeriesField?: Field;
21
+ syntheticSeriesField?: SyntheticSeriesField;
21
22
  }
22
23
  export declare const LineChartPluginFactory: RenderPluginFactory<LineChartPluginInstance>;
23
24
  export type { LineChartPluginInstance };
@@ -0,0 +1,3 @@
1
+ import { Field, RepeatedRecordCell } from '../../data_tree';
2
+ import type * as lite from 'vega-lite';
3
+ export declare function generateScatterChartSpec(data: RepeatedRecordCell, field: Field, vegaConfigOverride?: Record<string, unknown>): lite.TopLevelSpec;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The slice of `Field` the chart spec generators read off a series field,
3
+ * so the bar and line plugins' synthetic series fields stay honestly typed.
4
+ */
5
+ export interface SyntheticSeriesField {
6
+ name: string;
7
+ getLabel: () => string;
8
+ valueSet: ReadonlySet<string | number | boolean>;
9
+ referenceId: string;
10
+ maxString?: string;
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/render",
3
- "version": "0.0.405",
3
+ "version": "0.0.407",
4
4
  "license": "MIT",
5
5
  "main": "dist/module/index.umd.js",
6
6
  "types": "dist/module/index.d.ts",
@@ -29,8 +29,8 @@
29
29
  "generate-flow": "ts-node ../../scripts/gen-flow.ts"
30
30
  },
31
31
  "dependencies": {
32
- "@malloydata/malloy-interfaces": "0.0.405",
33
- "@malloydata/malloy-tag": "0.0.405",
32
+ "@malloydata/malloy-interfaces": "0.0.407",
33
+ "@malloydata/malloy-tag": "0.0.407",
34
34
  "@tanstack/solid-virtual": "^3.10.4",
35
35
  "lodash": "^4.18.1",
36
36
  "luxon": "^3.5.0",
@@ -42,8 +42,8 @@
42
42
  "vega-lite": "^5.2.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@malloydata/db-duckdb": "0.0.405",
46
- "@malloydata/malloy": "0.0.405",
45
+ "@malloydata/db-duckdb": "0.0.407",
46
+ "@malloydata/malloy": "0.0.407",
47
47
  "@storybook/addon-essentials": "^8.6.15",
48
48
  "@storybook/addon-interactions": "^8.6.15",
49
49
  "@storybook/addon-links": "^8.6.15",