@malloydata/render 0.0.293 → 0.0.294

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.
Files changed (132) hide show
  1. package/.storybook/malloy-stories-indexer.ts +20 -7
  2. package/README.md +8 -0
  3. package/dist/module/api/json-schema-types.d.ts +36 -0
  4. package/dist/{api → module/api}/malloy-renderer.d.ts +4 -1
  5. package/dist/{api → module/api}/malloy-viz.d.ts +6 -3
  6. package/dist/module/api/plugin-types.d.ts +42 -0
  7. package/dist/{api → module/api}/types.d.ts +5 -2
  8. package/dist/module/component/bar-chart/generate-bar_chart-vega-spec.d.ts +4 -0
  9. package/dist/{component → module/component}/bar-chart/get-bar_chart-settings.d.ts +3 -3
  10. package/dist/{component → module/component}/bar-chart/get-custom-tooltips-entries.d.ts +2 -2
  11. package/dist/{component → module/component}/chart/chart-dev-tool.d.ts +2 -2
  12. package/dist/{component → module/component/chart}/chart-layout-settings.d.ts +4 -4
  13. package/dist/module/component/chart/chart-v2.d.ts +23 -0
  14. package/dist/{component → module/component}/chart/chart.d.ts +3 -3
  15. package/dist/{component → module/component}/chart/default-chart-tooltip.d.ts +1 -1
  16. package/dist/{component → module/component}/dashboard/dashboard.d.ts +1 -1
  17. package/dist/{component → module/component}/legacy-charts/legacy_chart.d.ts +1 -1
  18. package/dist/{component → module/component}/malloy-modal/malloy-modal.d.ts +1 -1
  19. package/dist/{component → module/component}/render-image.d.ts +1 -1
  20. package/dist/{component → module/component}/render-link.d.ts +1 -1
  21. package/dist/{component → module/component}/render-list.d.ts +1 -1
  22. package/dist/{component → module/component}/render-numeric-field.d.ts +1 -1
  23. package/dist/{component → module/component}/render-result-metadata.d.ts +9 -6
  24. package/dist/{component → module/component}/render-time.d.ts +1 -1
  25. package/dist/{component → module/component}/render.d.ts +5 -2
  26. package/dist/{component → module/component/renderer}/apply-renderer.d.ts +1 -1
  27. package/dist/module/component/renderer/plugin-render-container.d.ts +8 -0
  28. package/dist/module/component/result-context.d.ts +4 -0
  29. package/dist/{component → module/component}/result-store/result-store.d.ts +3 -3
  30. package/dist/{component → module/component}/table/table-context.d.ts +3 -4
  31. package/dist/{component → module/component}/table/table-layout.d.ts +2 -2
  32. package/dist/{component → module/component}/table/table.d.ts +2 -2
  33. package/dist/{component → module/component}/tag-utils.d.ts +1 -1
  34. package/dist/{component → module/component}/tooltip/tooltip.d.ts +1 -1
  35. package/dist/{component → module/component}/types.d.ts +13 -4
  36. package/dist/{component → module/component}/util.d.ts +1 -1
  37. package/dist/{component → module/component}/vega/base-vega-config.d.ts +1 -1
  38. package/dist/{component → module/component}/vega/measure-axis.d.ts +2 -2
  39. package/dist/{component → module/component}/vega/vega-chart.d.ts +2 -4
  40. package/dist/{component → module/component}/vega/vega-utils.d.ts +1 -1
  41. package/dist/{component → module/component}/vega-types.d.ts +2 -2
  42. package/dist/{data_tree → module/data_tree}/cells/atomic.d.ts +3 -3
  43. package/dist/{data_tree → module/data_tree}/cells/base.d.ts +3 -4
  44. package/dist/{data_tree → module/data_tree}/cells/index.d.ts +2 -2
  45. package/dist/{data_tree → module/data_tree}/cells/nest.d.ts +9 -12
  46. package/dist/{data_tree → module/data_tree}/drilling.d.ts +2 -2
  47. package/dist/{data_tree → module/data_tree}/fields/atomic.d.ts +12 -12
  48. package/dist/{data_tree → module/data_tree}/fields/base.d.ts +9 -13
  49. package/dist/{data_tree → module/data_tree}/fields/index.d.ts +3 -4
  50. package/dist/{data_tree → module/data_tree}/fields/nest.d.ts +9 -11
  51. package/dist/{data_tree → module/data_tree}/index.d.ts +3 -4
  52. package/dist/{data_tree → module/data_tree}/types.d.ts +2 -7
  53. package/dist/{data_tree → module/data_tree}/utils.d.ts +8 -5
  54. package/dist/{html → module/html}/area_sparkline.d.ts +5 -5
  55. package/dist/{html → module/html}/bar_chart.d.ts +4 -4
  56. package/dist/{html → module/html}/bar_sparkline.d.ts +5 -5
  57. package/dist/{html → module/html}/boolean.d.ts +4 -4
  58. package/dist/{html → module/html}/bytes.d.ts +4 -4
  59. package/dist/{html → module/html}/cartesian_chart.d.ts +2 -2
  60. package/dist/{html → module/html}/chart.d.ts +4 -4
  61. package/dist/{html → module/html}/column_sparkline.d.ts +5 -5
  62. package/dist/{html → module/html}/container.d.ts +5 -6
  63. package/dist/{html → module/html}/currency.d.ts +4 -4
  64. package/dist/{html → module/html}/dashboard.d.ts +2 -2
  65. package/dist/{html → module/html}/data_styles.d.ts +1 -1
  66. package/dist/{html → module/html}/data_volume.d.ts +4 -4
  67. package/dist/{html → module/html}/date.d.ts +4 -4
  68. package/dist/{html → module/html}/duration.d.ts +4 -5
  69. package/dist/{html → module/html}/html_view.d.ts +5 -5
  70. package/dist/{html → module/html}/image.d.ts +4 -4
  71. package/dist/{html → module/html}/json.d.ts +4 -4
  72. package/dist/{html → module/html}/line_chart.d.ts +4 -4
  73. package/dist/{html → module/html}/link.d.ts +4 -4
  74. package/dist/{html → module/html}/list.d.ts +2 -2
  75. package/dist/{html → module/html}/list_detail.d.ts +1 -1
  76. package/dist/{html → module/html}/main_renderer_factory.d.ts +6 -6
  77. package/dist/{html → module/html}/number.d.ts +4 -4
  78. package/dist/{html → module/html}/percent.d.ts +4 -4
  79. package/dist/{html → module/html}/point_map.d.ts +5 -5
  80. package/dist/{html → module/html}/renderer.d.ts +3 -3
  81. package/dist/{html → module/html}/renderer_factory.d.ts +5 -5
  82. package/dist/{html → module/html}/renderer_types.d.ts +2 -2
  83. package/dist/{html → module/html}/scatter_chart.d.ts +4 -4
  84. package/dist/{html → module/html}/segment_map.d.ts +5 -5
  85. package/dist/{html → module/html}/shape_map.d.ts +5 -5
  86. package/dist/{html → module/html}/sparkline.d.ts +5 -5
  87. package/dist/{html → module/html}/table.d.ts +3 -3
  88. package/dist/{html → module/html}/text.d.ts +4 -4
  89. package/dist/{html → module/html}/unsupported.d.ts +4 -4
  90. package/dist/{html → module/html}/utils.d.ts +3 -3
  91. package/dist/{html → module/html}/vega_spec.d.ts +5 -5
  92. package/dist/module/index.d.ts +11 -0
  93. package/dist/module/index.mjs +34397 -32554
  94. package/dist/module/index.umd.js +423 -401
  95. package/dist/module/plugins/bar-chart/bar-chart-plugin.d.ts +14 -0
  96. package/dist/module/plugins/bar-chart/bar-chart-settings.d.ts +49 -0
  97. package/dist/module/plugins/bar-chart/generate-bar_chart-vega-spec.d.ts +4 -0
  98. package/dist/module/plugins/bar-chart/get-bar_chart-settings.d.ts +5 -0
  99. package/dist/module/plugins/bar-chart/settings-to-tag.d.ts +3 -0
  100. package/dist/module/plugins/dummy-dom-plugin.d.ts +8 -0
  101. package/dist/module/plugins/dummy-plugin.d.ts +8 -0
  102. package/dist/module/plugins/index.d.ts +3 -0
  103. package/dist/module/plugins/line-chart/generate-line_chart-vega-spec.d.ts +17 -0
  104. package/dist/module/plugins/line-chart/get-line_chart-settings.d.ts +5 -0
  105. package/dist/module/plugins/line-chart/line-chart-plugin.d.ts +21 -0
  106. package/dist/module/plugins/line-chart/line-chart-settings.d.ts +52 -0
  107. package/dist/module/plugins/line-chart/settings-to-tag.d.ts +3 -0
  108. package/dist/module/registry/types.d.ts +15 -0
  109. package/dist/module/render-field-metadata.d.ts +18 -0
  110. package/dist/{stories → module/stories}/themes.stories.d.ts +1 -2
  111. package/dist/{stories → module/stories}/util.d.ts +4 -4
  112. package/dist/{stories → module/stories}/vega-config-override.stories.d.ts +1 -2
  113. package/dist/module/stories/wrapped-table.stories.d.ts +9 -0
  114. package/dist/{util.d.ts → module/util.d.ts} +11 -4
  115. package/package.json +10 -10
  116. package/{vite.config.base.ts → vite.config.base.mts} +11 -1
  117. package/{vite.config.ts → vite.config.mts} +1 -1
  118. package/dist/component/bar-chart/generate-bar_chart-vega-spec.d.ts +0 -4
  119. package/dist/component/line-chart/generate-line_chart-vega-spec.d.ts +0 -4
  120. package/dist/component/line-chart/get-line_chart-settings.d.ts +0 -11
  121. package/dist/component/result-context.d.ts +0 -4
  122. package/dist/data_tree/plugins.d.ts +0 -14
  123. package/dist/index.d.ts +0 -7
  124. package/dist/plugins/line-chart-series-plugin.d.ts +0 -7
  125. package/dist/render-field-metadata.d.ts +0 -33
  126. /package/dist/{component → module/component}/chart/debug_icon.d.ts +0 -0
  127. /package/dist/{component → module/component}/default-settings.d.ts +0 -0
  128. /package/dist/{component → module/component}/error-message/error-message.d.ts +0 -0
  129. /package/dist/{component → module/component}/vega/merge-vega-configs.d.ts +0 -0
  130. /package/dist/{component → module/component}/vega/vega-expr-addons.d.ts +0 -0
  131. /package/dist/{html → module/html}/index.d.ts +0 -0
  132. /package/dist/{html → module/html}/state_codes.d.ts +0 -0
@@ -142,6 +142,8 @@ export function viteMalloyStoriesPlugin(): PluginOption {
142
142
  import {createLoader} from './util';
143
143
  import './themes.css';
144
144
  import {MalloyRenderer} from '../api/malloy-renderer';
145
+ import {DummyPluginFactory} from '@/plugins/dummy-plugin';
146
+ import {DummyDOMPluginFactory} from '@/plugins/dummy-dom-plugin';
145
147
 
146
148
  const meta = {
147
149
  title: "Malloy Next/${modelStoriesMeta.componentName}",
@@ -161,16 +163,27 @@ export function viteMalloyStoriesPlugin(): PluginOption {
161
163
  targetElement.style.width = '100%';
162
164
  parent.appendChild(targetElement);
163
165
 
164
- const renderer = new MalloyRenderer();
166
+ const renderer = new MalloyRenderer({
167
+ plugins: [
168
+ DummyPluginFactory,
169
+ DummyDOMPluginFactory,
170
+ ],
171
+ });
165
172
  const viz = renderer.createViz({
166
- // modelDef: context.loaded['result'].modelDef
167
- }, {
168
- onError: (error) => {
169
- console.log("Malloy render error", error);
170
- }
173
+ onError: error => {
174
+ console.log('Malloy render error', error);
175
+ },
171
176
  });
172
177
  viz.setResult(context.loaded['result']);
173
- console.log('initial state', viz.getMetadata());
178
+ const metadata = viz.getMetadata();
179
+ console.group('MalloyViz metadata');
180
+ console.log('initial state', metadata);
181
+ console.log('render properties', metadata.getFieldEntry(metadata.rootField.key).renderProperties);
182
+ const plugin = viz.getActivePlugin(metadata.rootField.key);
183
+ console.log('plugin', plugin, plugin?.getSettings());
184
+ const tag = plugin?.settingsToTag(plugin?.getSettings());
185
+ console.log('tag', tag, tag?.toString());
186
+ console.groupEnd();
174
187
  viz.render(targetElement);
175
188
 
176
189
  return parent;
package/README.md CHANGED
@@ -46,6 +46,14 @@ registerMalloyRender({
46
46
  });
47
47
  ```
48
48
 
49
+ ## Plugin System
50
+
51
+ The Malloy Renderer supports a plugin system for creating custom visualizations. See the plugin documentation:
52
+
53
+ - [Plugin System Overview](./docs/plugin-system.md) - Comprehensive guide to the plugin architecture
54
+ - [Plugin Quick Start](./docs/plugin-quick-start.md) - Get started quickly with minimal examples
55
+ - [Plugin API Reference](./docs/plugin-api-reference.md) - Complete API documentation
56
+
49
57
  # Developing
50
58
 
51
59
  See the [Developing README](./DEVELOPING.md)
@@ -0,0 +1,36 @@
1
+ export interface JSONSchemaPropertyBase {
2
+ title?: string;
3
+ description?: string;
4
+ default?: unknown;
5
+ }
6
+ export type JSONSchemaProperty = JSONSchemaObject | JSONSchemaArray | JSONSchemaString | JSONSchemaFieldString | JSONSchemaNumber | JSONSchemaBoolean | JSONSchemaOneOf;
7
+ export interface JSONSchemaObject extends JSONSchemaPropertyBase {
8
+ type: 'object';
9
+ properties: Record<string, JSONSchemaProperty>;
10
+ required?: readonly string[];
11
+ additionalProperties?: boolean;
12
+ }
13
+ export interface JSONSchemaArray extends JSONSchemaPropertyBase {
14
+ type: 'array';
15
+ items: JSONSchemaProperty;
16
+ }
17
+ export interface JSONSchemaString extends JSONSchemaPropertyBase {
18
+ type: 'string';
19
+ enum?: readonly string[];
20
+ }
21
+ export interface JSONSchemaFieldString extends JSONSchemaString {
22
+ subtype: 'field';
23
+ fieldTypes?: readonly string[];
24
+ }
25
+ export interface JSONSchemaNumber extends JSONSchemaPropertyBase {
26
+ type: 'number';
27
+ minimum?: number;
28
+ maximum?: number;
29
+ }
30
+ export interface JSONSchemaBoolean extends JSONSchemaPropertyBase {
31
+ type: 'boolean';
32
+ }
33
+ export interface JSONSchemaOneOf extends JSONSchemaPropertyBase {
34
+ type: 'oneOf';
35
+ oneOf: JSONSchemaProperty[];
36
+ }
@@ -1,9 +1,12 @@
1
- import type { MalloyRendererOptions } from './types';
1
+ import { MalloyRendererOptions } from './types';
2
+ import { RenderPluginFactory } from './plugin-types';
2
3
  import { MalloyViz } from './malloy-viz';
3
4
  export declare class MalloyRenderer {
4
5
  private globalOptions;
6
+ private pluginRegistry;
5
7
  constructor(options?: MalloyRendererOptions);
6
8
  createViz(additionalOptions?: Partial<MalloyRendererOptions>): MalloyViz;
7
9
  updateOptions(newOptions: Partial<MalloyRendererOptions>): void;
8
10
  getOptions(): MalloyRendererOptions;
11
+ getRegisteredPlugins(): RenderPluginFactory[];
9
12
  }
@@ -1,13 +1,15 @@
1
- import type { MalloyRendererOptions } from '@/api/types';
1
+ import { MalloyRendererOptions } from './types';
2
+ import { RenderPluginFactory, RenderPluginInstance } from './plugin-types';
3
+ import { RenderFieldMetadata } from '../render-field-metadata';
2
4
  import type * as Malloy from '@malloydata/malloy-interfaces';
3
- import { RenderFieldMetadata } from '@/render-field-metadata';
4
5
  export declare class MalloyViz {
5
6
  private options;
6
7
  private disposeFn;
7
8
  private targetElement;
8
9
  private result;
9
10
  private metadata;
10
- constructor(options: MalloyRendererOptions);
11
+ private pluginRegistry;
12
+ constructor(options: MalloyRendererOptions, pluginRegistry?: RenderPluginFactory[]);
11
13
  static addStylesheet(styles: string): void;
12
14
  getHTML(): Promise<string>;
13
15
  copyToHTML(): Promise<void>;
@@ -16,4 +18,5 @@ export declare class MalloyViz {
16
18
  remove(): void;
17
19
  updateOptions(newOptions: Partial<MalloyRendererOptions>): void;
18
20
  getMetadata(): RenderFieldMetadata | null;
21
+ getActivePlugin(fieldKey: string): RenderPluginInstance | null;
19
22
  }
@@ -0,0 +1,42 @@
1
+ import { JSXElement } from 'solid-js';
2
+ import { Tag } from '@malloydata/malloy-tag';
3
+ import { Field, NestField, NestCell, FieldType, Cell } from '../data_tree';
4
+ import { RenderMetadata, GetResultMetadataOptions } from '../component/render-result-metadata';
5
+ import { JSONSchemaObject } from './json-schema-types';
6
+ export interface RenderProps {
7
+ dataColumn: Cell;
8
+ field: Field;
9
+ customProps?: Record<string, unknown>;
10
+ }
11
+ interface BaseRenderPluginInstance<TMetadata = unknown> {
12
+ readonly name: string;
13
+ readonly field: Field;
14
+ readonly sizingStrategy: 'fixed' | 'fill';
15
+ getMetadata(): TMetadata;
16
+ processData?(field: NestField, cell: NestCell): void;
17
+ beforeRender?(metadata: RenderMetadata, options: GetResultMetadataOptions): void;
18
+ }
19
+ export interface SolidJSRenderPluginInstance<TMetadata = unknown> extends BaseRenderPluginInstance<TMetadata> {
20
+ readonly renderMode: 'solidjs';
21
+ renderComponent(props: RenderProps): JSXElement;
22
+ }
23
+ export interface DOMRenderPluginInstance<TMetadata = unknown> extends BaseRenderPluginInstance<TMetadata> {
24
+ readonly renderMode: 'dom';
25
+ renderToDOM(container: HTMLElement, props: RenderProps): void;
26
+ cleanup?(container: HTMLElement): void;
27
+ }
28
+ export type RenderPluginInstance<TMetadata = unknown> = SolidJSRenderPluginInstance<TMetadata> | DOMRenderPluginInstance<TMetadata>;
29
+ export interface CoreVizPluginMethods {
30
+ getSchema(): JSONSchemaObject;
31
+ getSettings(): Record<string, unknown>;
32
+ getDefaultSettings(): Record<string, unknown>;
33
+ settingsToTag(settings: Record<string, unknown>): Tag;
34
+ }
35
+ export type CoreVizPluginInstance<TMetadata = unknown> = SolidJSRenderPluginInstance<TMetadata> & CoreVizPluginMethods;
36
+ export interface RenderPluginFactory<TInstance extends RenderPluginInstance = RenderPluginInstance> {
37
+ readonly name: string;
38
+ matches(field: Field, fieldTag: Tag, fieldType: FieldType): boolean;
39
+ create(field: Field, pluginOptions?: unknown, modelTag?: Tag): TInstance;
40
+ }
41
+ export declare function isCoreVizPluginInstance(plugin: RenderPluginInstance): plugin is CoreVizPluginInstance;
42
+ export {};
@@ -1,5 +1,6 @@
1
- import type { DashboardConfig, DrillData, MalloyClickEventPayload, TableConfig, VegaConfigHandler } from '../component/types';
2
- export type { RenderFieldMetadata } from '@/render-field-metadata';
1
+ import { DashboardConfig, DrillData, MalloyClickEventPayload, TableConfig, VegaConfigHandler } from '../component/types';
2
+ import { RenderPluginFactory } from './plugin-types';
3
+ export type { RenderFieldMetadata } from '../render-field-metadata';
3
4
  export interface MalloyRendererOptions {
4
5
  onClick?: (payload: MalloyClickEventPayload) => void;
5
6
  onDrill?: (drillData: DrillData) => void;
@@ -9,4 +10,6 @@ export interface MalloyRendererOptions {
9
10
  modalElement?: HTMLElement;
10
11
  scrollEl?: HTMLElement;
11
12
  onError?: (error: Error) => void;
13
+ plugins?: RenderPluginFactory[];
14
+ pluginOptions?: Record<string, unknown>;
12
15
  }
@@ -0,0 +1,4 @@
1
+ import { VegaChartProps } from '../types';
2
+ import { RepeatedRecordField } from '../../data_tree';
3
+ import { RenderMetadata } from '../render-result-metadata';
4
+ export declare function generateBarChartVegaSpec(explore: RepeatedRecordField, metadata: RenderMetadata): VegaChartProps;
@@ -1,6 +1,6 @@
1
- import type { Tag } from '@malloydata/malloy-tag';
2
- import type { Channel } from '../types';
3
- import type { RepeatedRecordField } from '../../data_tree';
1
+ import { Tag } from '@malloydata/malloy-tag';
2
+ import { Channel } from '../types';
3
+ import { RepeatedRecordField } from '../../data_tree';
4
4
  export type BarChartSettings = {
5
5
  xChannel: Channel;
6
6
  yChannel: Channel;
@@ -1,5 +1,5 @@
1
- import type { MalloyVegaDataRecord } from '../types';
2
- import type { NestField } from '../../data_tree';
1
+ import { MalloyVegaDataRecord } from '../types';
2
+ import { NestField } from '../../data_tree';
3
3
  type CustomTooltipGetterOptions = {
4
4
  explore: NestField;
5
5
  records: MalloyVegaDataRecord[];
@@ -1,5 +1,5 @@
1
- import type { ChartProps } from './chart';
2
- import type { VegaChartProps } from '../types';
1
+ import { ChartProps } from './chart';
2
+ import { VegaChartProps } from '../types';
3
3
  type ChartDevToolProps = {
4
4
  onClose: () => void;
5
5
  chartProps: VegaChartProps;
@@ -1,7 +1,7 @@
1
- import type { Tag } from '@malloydata/malloy-tag';
2
- import type { AlignValue, TextBaselineValue } from 'vega';
3
- import type { Field, NestField } from '../data_tree';
4
- import type { RenderMetadata } from './render-result-metadata';
1
+ import { Tag } from '@malloydata/malloy-tag';
2
+ import { AlignValue, TextBaselineValue } from 'vega';
3
+ import { Field, NestField } from '../../data_tree';
4
+ import { RenderMetadata } from '../render-result-metadata';
5
5
  type XAxisSettings = {
6
6
  labelAngle: number;
7
7
  labelAlign?: AlignValue;
@@ -0,0 +1,23 @@
1
+ import { ChartTooltipEntry } from '../types';
2
+ import { Item, Runtime, View } from 'vega';
3
+ import { RepeatedRecordCell } from '../../data_tree';
4
+ export type ChartV2Props = {
5
+ data: RepeatedRecordCell;
6
+ values: unknown[];
7
+ runtime: Runtime;
8
+ vegaSpec: unknown;
9
+ plotWidth: number;
10
+ plotHeight: number;
11
+ totalWidth: number;
12
+ totalHeight: number;
13
+ chartTag?: {
14
+ text?: (key: string) => string | undefined;
15
+ };
16
+ getTooltipData?: (item: Item, view: View) => ChartTooltipEntry | null;
17
+ isDataLimited?: boolean;
18
+ dataLimitMessage?: string;
19
+ devMode?: boolean;
20
+ onView?: (view: View) => void;
21
+ };
22
+ export declare function ChartV2(props: ChartV2Props): import("solid-js").JSX.Element;
23
+ export declare function ChartV2Inner(props: ChartV2Props): import("solid-js").JSX.Element;
@@ -1,6 +1,6 @@
1
- import type { VegaChartProps } from '../types';
2
- import type { Runtime, View } from 'vega';
3
- import type { RepeatedRecordCell } from '../../data_tree';
1
+ import { VegaChartProps } from '../types';
2
+ import { Runtime, View } from 'vega';
3
+ import { RepeatedRecordCell } from '../../data_tree';
4
4
  export type ChartProps = {
5
5
  data: RepeatedRecordCell;
6
6
  devMode?: boolean;
@@ -1,4 +1,4 @@
1
- import type { ChartTooltipEntry } from '../types';
1
+ import { ChartTooltipEntry } from '../types';
2
2
  export declare function DefaultChartTooltip(props: {
3
3
  data: ChartTooltipEntry;
4
4
  }): import("solid-js").JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { RecordOrRepeatedRecordCell } from '@/data_tree';
1
+ import { RecordOrRepeatedRecordCell } from '../../data_tree';
2
2
  export declare function Dashboard(props: {
3
3
  data: RecordOrRepeatedRecordCell;
4
4
  scrollEl?: HTMLElement;
@@ -1,4 +1,4 @@
1
- import type { RepeatedRecordCell } from '../../data_tree';
1
+ import { RepeatedRecordCell } from '../../data_tree';
2
2
  export declare function LegacyChart(props: {
3
3
  data: RepeatedRecordCell;
4
4
  type: string;
@@ -1,4 +1,4 @@
1
- import type { JSX, JSXElement } from 'solid-js';
1
+ import { JSX, JSXElement } from 'solid-js';
2
2
  export declare function MalloyModal(props: {
3
3
  style?: string | JSX.CSSProperties;
4
4
  children?: JSXElement;
@@ -1,2 +1,2 @@
1
- import type { RendererProps } from './types';
1
+ import { RendererProps } from './types';
2
2
  export declare function renderImage(props: RendererProps): import("solid-js").JSX.Element;
@@ -1,2 +1,2 @@
1
- import type { Cell, Field } from '../data_tree';
1
+ import { Cell, Field } from '../data_tree';
2
2
  export declare function renderLink(f: Field, data: Cell): "∅" | import("solid-js").JSX.Element;
@@ -1,2 +1,2 @@
1
- import type { RendererProps } from './types';
1
+ import { RendererProps } from './types';
2
2
  export declare function renderList(props: RendererProps): "∅" | import("solid-js").JSX.Element;
@@ -1,2 +1,2 @@
1
- import type { Field } from '../data_tree';
1
+ import { Field } from '../data_tree';
2
2
  export declare function renderNumericField(f: Field, value: number | null | undefined): string;
@@ -1,9 +1,11 @@
1
- import type { Tag } from '@malloydata/malloy-tag';
2
- import type { VegaChartProps, VegaConfigHandler } from './types';
3
- import type { ResultStore } from '@/component/result-store/result-store';
4
- import type { Runtime } from 'vega';
5
- import type { RootField } from '@/data_tree';
1
+ import { Tag } from '@malloydata/malloy-tag';
2
+ import { VegaChartProps, VegaConfigHandler } from './types';
3
+ import { ResultStore } from './result-store/result-store';
4
+ import { Runtime } from 'vega';
5
+ import { RootField } from '../data_tree';
6
+ import { RenderFieldMetadata } from '../render-field-metadata';
6
7
  export type GetResultMetadataOptions = {
8
+ renderFieldMetadata: RenderFieldMetadata;
7
9
  getVegaConfigOverride?: VegaConfigHandler;
8
10
  parentSize: {
9
11
  width: number;
@@ -25,6 +27,7 @@ export interface RenderMetadata {
25
27
  };
26
28
  renderAs: string;
27
29
  sizingStrategy: 'fill' | 'fixed';
30
+ renderFieldMetadata: RenderFieldMetadata;
28
31
  }
29
- export declare function getResultMetadata(rootField: RootField, options?: GetResultMetadataOptions): RenderMetadata;
32
+ export declare function getResultMetadata(rootField: RootField, options: GetResultMetadataOptions): RenderMetadata;
30
33
  export declare function shouldRenderChartAs(tag: Tag): string | undefined;
@@ -1,2 +1,2 @@
1
- import type { RendererProps } from './types';
1
+ import { RendererProps } from './types';
2
2
  export declare function renderTime({ dataColumn }: RendererProps): string;
@@ -1,5 +1,6 @@
1
- import type { Accessor } from 'solid-js';
2
- import type { DashboardConfig, DrillData, MalloyClickEventPayload, TableConfig, VegaConfigHandler } from './types';
1
+ import { Accessor } from 'solid-js';
2
+ import { DashboardConfig, DrillData, MalloyClickEventPayload, TableConfig, VegaConfigHandler } from './types';
3
+ import { RenderFieldMetadata } from '../render-field-metadata';
3
4
  export type { DrillData } from './types';
4
5
  import type * as Malloy from '@malloydata/malloy-interfaces';
5
6
  export type MalloyRenderProps = {
@@ -13,6 +14,7 @@ export type MalloyRenderProps = {
13
14
  vegaConfigOverride?: VegaConfigHandler;
14
15
  tableConfig?: Partial<TableConfig>;
15
16
  dashboardConfig?: Partial<DashboardConfig>;
17
+ renderFieldMetadata: RenderFieldMetadata;
16
18
  };
17
19
  export declare const useConfig: () => {
18
20
  tableConfig: Accessor<TableConfig>;
@@ -28,4 +30,5 @@ export declare function MalloyRenderInner(props: {
28
30
  element: HTMLElement;
29
31
  scrollEl?: HTMLElement;
30
32
  vegaConfigOverride?: VegaConfigHandler;
33
+ renderFieldMetadata: RenderFieldMetadata;
31
34
  }): import("solid-js").JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { RendererProps } from './types';
1
+ import { RendererProps } from '../types';
2
2
  export declare function applyRenderer(props: RendererProps): {
3
3
  renderAs: string;
4
4
  renderValue: import("solid-js").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { RenderProps, RenderPluginInstance } from '../../api/plugin-types';
2
+ export interface PluginRenderContainerProps {
3
+ plugin: RenderPluginInstance;
4
+ renderProps: RenderProps;
5
+ class?: string;
6
+ style?: Record<string, string>;
7
+ }
8
+ export declare function PluginRenderContainer(props: PluginRenderContainerProps): import("solid-js").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { Accessor } from 'solid-js';
2
+ import { RenderMetadata } from './render-result-metadata';
3
+ export declare const ResultContext: import('solid-js').Context<Accessor<RenderMetadata> | undefined>;
4
+ export declare const useResultContext: () => RenderMetadata;
@@ -1,6 +1,6 @@
1
- import type { DrillData } from '../types';
2
- import type { Cell } from '../../data_tree';
3
- import type { RenderMetadata } from '../render-result-metadata';
1
+ import { DrillData } from '../types';
2
+ import { Cell } from '../../data_tree';
3
+ import { RenderMetadata } from '../render-result-metadata';
4
4
  interface BrushDataBase {
5
5
  fieldRefId: string;
6
6
  sourceId: string;
@@ -1,6 +1,5 @@
1
- import type { SetStoreFunction, Store } from 'solid-js/store';
2
- import { createStore } from 'solid-js/store';
3
- import type { TableLayout } from './table-layout';
1
+ import { SetStoreFunction, Store, createStore } from 'solid-js/store';
2
+ import { TableLayout } from './table-layout';
4
3
  type TableStore = {
5
4
  headerSizes: Record<string, number>;
6
5
  columnWidths: Record<string, number>;
@@ -17,7 +16,7 @@ export type TableContext = {
17
16
  currentRow: number[];
18
17
  currentExplore: string[];
19
18
  };
20
- export declare const TableContext: import("solid-js").Context<TableContext | undefined>;
19
+ export declare const TableContext: import('solid-js').Context<TableContext | undefined>;
21
20
  export declare const useTableContext: () => TableContext | undefined;
22
21
  export declare function createTableStore(): [get: TableStore, set: SetStoreFunction<TableStore>];
23
22
  export {};
@@ -1,5 +1,5 @@
1
- import type { Field, NestField } from '../../data_tree';
2
- import type { FieldHeaderRangeMap } from '../types';
1
+ import { Field, NestField } from '../../data_tree';
2
+ import { FieldHeaderRangeMap } from '../types';
3
3
  type LayoutEntry = {
4
4
  field: Field;
5
5
  width: number | null;
@@ -1,5 +1,5 @@
1
- import type { Component } from 'solid-js';
2
- import type { RecordOrRepeatedRecordCell } from '../../data_tree';
1
+ import { Component } from 'solid-js';
2
+ import { RecordOrRepeatedRecordCell } from '../../data_tree';
3
3
  declare const MalloyTable: Component<{
4
4
  data: RecordOrRepeatedRecordCell;
5
5
  rowLimit?: number;
@@ -1,4 +1,4 @@
1
- import type { Tag } from '@malloydata/malloy-tag';
1
+ import { Tag } from '@malloydata/malloy-tag';
2
2
  export declare const VIZ_CHART_TYPES: string[];
3
3
  /**
4
4
  * Convert legacy chart tags to viz format internally.
@@ -1,4 +1,4 @@
1
- import type { JSXElement } from 'solid-js';
1
+ import { JSXElement } from 'solid-js';
2
2
  export declare function Tooltip(props: {
3
3
  show: boolean;
4
4
  children: JSXElement;
@@ -1,8 +1,8 @@
1
+ import { Tag } from '@malloydata/malloy-tag';
2
+ import { Item, Spec, View } from 'vega';
3
+ import { JSX } from 'solid-js';
4
+ import { Cell, DrillEntry, Field, RecordCell, RepeatedRecordCell } from '../data_tree';
1
5
  import type * as Malloy from '@malloydata/malloy-interfaces';
2
- import type { Tag } from '@malloydata/malloy-tag';
3
- import type { Item, Spec, View } from 'vega';
4
- import type { JSX } from 'solid-js';
5
- import type { Cell, DrillEntry, Field, RecordCell, RepeatedRecordCell } from '../data_tree';
6
6
  export type RendererProps = {
7
7
  dataColumn: Cell;
8
8
  tag: Tag;
@@ -66,6 +66,15 @@ type ScaleType = 'quantitative' | 'nominal';
66
66
  export type Channel = {
67
67
  fields: string[];
68
68
  type: ScaleType | null;
69
+ independent: boolean | 'auto';
70
+ };
71
+ export type YChannel = {
72
+ fields: string[];
73
+ type: ScaleType | null;
74
+ independent: boolean;
75
+ };
76
+ export type SeriesChannel = Channel & {
77
+ limit: number | 'auto';
69
78
  };
70
79
  export type TableConfig = {
71
80
  disableVirtualization: boolean;
@@ -1,4 +1,4 @@
1
- import { type Accessor, type Setter } from 'solid-js';
1
+ import { Accessor, Setter } from 'solid-js';
2
2
  export declare function getTextWidthCanvas(text: string, font: string, canvasToUse?: HTMLCanvasElement): number;
3
3
  export declare function getTextWidthDOM(text: string, styles: Record<string, string>): number;
4
4
  export declare function clamp(s: number, e: number, v: number): number;
@@ -1,4 +1,4 @@
1
- import type { Config } from 'vega';
1
+ import { Config } from 'vega';
2
2
  export declare const grayMedium = "#727883";
3
3
  export declare const gridGray = "#E5E7EB";
4
4
  export declare const baseVegaConfig: () => Config;
@@ -1,5 +1,5 @@
1
- import type { Axis, GroupMark, RectMark } from 'vega';
2
- import type { ChartLayoutSettings } from '../chart-layout-settings';
1
+ import { Axis, GroupMark, RectMark } from 'vega';
2
+ import { ChartLayoutSettings } from '../chart/chart-layout-settings';
3
3
  type MeasureAxisOptions = {
4
4
  type: 'y';
5
5
  title: string;
@@ -1,7 +1,5 @@
1
- import type { EventListenerHandler, SignalListenerHandler, Runtime } from 'vega';
2
- import { View } from 'vega';
3
- import './vega-expr-addons';
4
- import type { RepeatedRecordField } from '../../data_tree';
1
+ import { EventListenerHandler, SignalListenerHandler, Runtime, View } from 'vega';
2
+ import { RepeatedRecordField } from '../../data_tree';
5
3
  type VegaChartProps = {
6
4
  explore: RepeatedRecordField;
7
5
  width?: number;
@@ -1,4 +1,4 @@
1
- import type { Item, SignalListenerHandler, View } from 'vega';
1
+ import { Item, SignalListenerHandler, View } from 'vega';
2
2
  export declare function addSignalListenerIfExists(view: View, signal: string, cb: SignalListenerHandler): void;
3
3
  export declare function setSignalIfExists(view: View, signal: string, value: unknown): void;
4
4
  export declare function getMarkName(item: Item): string;
@@ -1,5 +1,5 @@
1
- import type { Spec } from 'vega';
2
- import type { TopLevelSpec } from 'vega-lite';
1
+ import { Spec } from 'vega';
2
+ import { TopLevelSpec } from 'vega-lite';
3
3
  /**
4
4
  * TODO: create vega-lite-types package that exports types from vega-lite
5
5
  * Because vega-lite typings are not available today, we are forced to use any
@@ -1,7 +1,7 @@
1
- import type * as Malloy from '@malloydata/malloy-interfaces';
2
- import type { BooleanField, DateField, Field, JSONField, NumberField, SQLNativeField, StringField, TimestampField } from '../fields';
1
+ import { BooleanField, DateField, Field, JSONField, NumberField, SQLNativeField, StringField, TimestampField } from '../fields';
3
2
  import { CellBase } from './base';
4
- import type { Cell, NestCell } from '.';
3
+ import { Cell, NestCell } from '.';
4
+ import type * as Malloy from '@malloydata/malloy-interfaces';
5
5
  export declare class NullCell extends CellBase {
6
6
  readonly cell: Malloy.CellWithNullCell;
7
7
  readonly field: Field;
@@ -1,8 +1,7 @@
1
+ import { Cell, NestCell, RecordCell, ArrayCell, BooleanCell, DateCell, JSONCell, NullCell, NumberCell, RepeatedRecordCell, StringCell, TimestampCell, TimeCell, RecordOrRepeatedRecordCell, CellValue } from '.';
2
+ import { Field } from '../fields';
3
+ import { DrillEntry } from '../types';
1
4
  import type * as Malloy from '@malloydata/malloy-interfaces';
2
- import type { Cell, NestCell, RecordCell } from '.';
3
- import type { Field } from '../fields';
4
- import { ArrayCell, BooleanCell, DateCell, JSONCell, NullCell, NumberCell, RepeatedRecordCell, StringCell, TimestampCell, type TimeCell, type RecordOrRepeatedRecordCell, type CellValue } from '.';
5
- import type { DrillEntry } from '../types';
6
5
  export declare abstract class CellBase {
7
6
  readonly cell: Malloy.Cell;
8
7
  readonly field: Field;
@@ -1,7 +1,7 @@
1
- import type * as Malloy from '@malloydata/malloy-interfaces';
2
- import { type Field } from '../fields';
1
+ import { Field } from '../fields';
3
2
  import { ArrayCell, RecordCell, RepeatedRecordCell } from './nest';
4
3
  import { BooleanCell, DateCell, JSONCell, NullCell, NumberCell, SQLNativeCell, StringCell, TimestampCell } from './atomic';
4
+ import type * as Malloy from '@malloydata/malloy-interfaces';
5
5
  export { ArrayCell, RecordCell, RepeatedRecordCell, RootCell } from './nest';
6
6
  export { BooleanCell, DateCell, JSONCell, NullCell, NumberCell, SQLNativeCell, StringCell, TimestampCell, } from './atomic';
7
7
  export type NestCell = ArrayCell | RecordCell;