@malloydata/render 0.0.293 → 0.0.295
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.
- package/.storybook/malloy-stories-indexer.ts +24 -7
- package/README.md +8 -0
- package/dist/module/api/json-schema-types.d.ts +36 -0
- package/dist/{api → module/api}/malloy-renderer.d.ts +4 -1
- package/dist/{api → module/api}/malloy-viz.d.ts +6 -3
- package/dist/module/api/plugin-types.d.ts +42 -0
- package/dist/{api → module/api}/types.d.ts +5 -2
- package/dist/module/component/bar-chart/generate-bar_chart-vega-spec.d.ts +4 -0
- package/dist/{component → module/component}/bar-chart/get-bar_chart-settings.d.ts +3 -3
- package/dist/{component → module/component}/bar-chart/get-custom-tooltips-entries.d.ts +2 -2
- package/dist/{component → module/component}/chart/chart-dev-tool.d.ts +2 -2
- package/dist/{component → module/component/chart}/chart-layout-settings.d.ts +4 -4
- package/dist/module/component/chart/chart-v2.d.ts +23 -0
- package/dist/{component → module/component}/chart/chart.d.ts +3 -3
- package/dist/{component → module/component}/chart/default-chart-tooltip.d.ts +1 -1
- package/dist/{component → module/component}/dashboard/dashboard.d.ts +1 -1
- package/dist/{component → module/component}/legacy-charts/legacy_chart.d.ts +1 -1
- package/dist/{component → module/component}/malloy-modal/malloy-modal.d.ts +1 -1
- package/dist/{component → module/component}/render-image.d.ts +1 -1
- package/dist/{component → module/component}/render-link.d.ts +1 -1
- package/dist/{component → module/component}/render-list.d.ts +1 -1
- package/dist/module/component/render-numeric-field.d.ts +4 -0
- package/dist/{component → module/component}/render-result-metadata.d.ts +9 -6
- package/dist/{component → module/component}/render-time.d.ts +1 -1
- package/dist/{component → module/component}/render.d.ts +5 -2
- package/dist/{component → module/component/renderer}/apply-renderer.d.ts +1 -1
- package/dist/module/component/renderer/plugin-render-container.d.ts +8 -0
- package/dist/module/component/result-context.d.ts +4 -0
- package/dist/{component → module/component}/result-store/result-store.d.ts +3 -3
- package/dist/{component → module/component}/table/table-context.d.ts +3 -4
- package/dist/{component → module/component}/table/table-layout.d.ts +2 -2
- package/dist/{component → module/component}/table/table.d.ts +2 -2
- package/dist/{component → module/component}/tag-utils.d.ts +1 -1
- package/dist/{component → module/component}/tooltip/tooltip.d.ts +1 -1
- package/dist/{component → module/component}/types.d.ts +13 -4
- package/dist/{component → module/component}/util.d.ts +1 -1
- package/dist/{component → module/component}/vega/base-vega-config.d.ts +1 -1
- package/dist/{component → module/component}/vega/measure-axis.d.ts +2 -2
- package/dist/{component → module/component}/vega/vega-chart.d.ts +2 -4
- package/dist/{component → module/component}/vega/vega-utils.d.ts +1 -1
- package/dist/{component → module/component}/vega-types.d.ts +2 -2
- package/dist/{data_tree → module/data_tree}/cells/atomic.d.ts +3 -3
- package/dist/{data_tree → module/data_tree}/cells/base.d.ts +3 -4
- package/dist/{data_tree → module/data_tree}/cells/index.d.ts +2 -2
- package/dist/{data_tree → module/data_tree}/cells/nest.d.ts +9 -12
- package/dist/{data_tree → module/data_tree}/drilling.d.ts +2 -2
- package/dist/{data_tree → module/data_tree}/fields/atomic.d.ts +12 -12
- package/dist/{data_tree → module/data_tree}/fields/base.d.ts +10 -14
- package/dist/{data_tree → module/data_tree}/fields/index.d.ts +3 -4
- package/dist/{data_tree → module/data_tree}/fields/nest.d.ts +9 -11
- package/dist/{data_tree → module/data_tree}/index.d.ts +3 -4
- package/dist/{data_tree → module/data_tree}/types.d.ts +2 -7
- package/dist/{data_tree → module/data_tree}/utils.d.ts +10 -6
- package/dist/{html → module/html}/area_sparkline.d.ts +5 -5
- package/dist/{html → module/html}/bar_chart.d.ts +4 -4
- package/dist/{html → module/html}/bar_sparkline.d.ts +5 -5
- package/dist/{html → module/html}/boolean.d.ts +4 -4
- package/dist/{html → module/html}/bytes.d.ts +4 -4
- package/dist/{html → module/html}/cartesian_chart.d.ts +2 -2
- package/dist/{html → module/html}/chart.d.ts +4 -4
- package/dist/{html → module/html}/column_sparkline.d.ts +5 -5
- package/dist/{html → module/html}/container.d.ts +5 -6
- package/dist/{html → module/html}/currency.d.ts +4 -4
- package/dist/{html → module/html}/dashboard.d.ts +2 -2
- package/dist/{html → module/html}/data_styles.d.ts +1 -1
- package/dist/{html → module/html}/data_volume.d.ts +4 -4
- package/dist/{html → module/html}/date.d.ts +4 -4
- package/dist/{html → module/html}/duration.d.ts +4 -5
- package/dist/{html → module/html}/html_view.d.ts +5 -5
- package/dist/{html → module/html}/image.d.ts +4 -4
- package/dist/{html → module/html}/json.d.ts +4 -4
- package/dist/{html → module/html}/line_chart.d.ts +4 -4
- package/dist/{html → module/html}/link.d.ts +4 -4
- package/dist/{html → module/html}/list.d.ts +2 -2
- package/dist/{html → module/html}/list_detail.d.ts +1 -1
- package/dist/{html → module/html}/main_renderer_factory.d.ts +6 -6
- package/dist/{html → module/html}/number.d.ts +4 -4
- package/dist/{html → module/html}/percent.d.ts +4 -4
- package/dist/{html → module/html}/point_map.d.ts +5 -5
- package/dist/{html → module/html}/renderer.d.ts +3 -3
- package/dist/{html → module/html}/renderer_factory.d.ts +5 -5
- package/dist/{html → module/html}/renderer_types.d.ts +2 -2
- package/dist/{html → module/html}/scatter_chart.d.ts +4 -4
- package/dist/{html → module/html}/segment_map.d.ts +5 -5
- package/dist/{html → module/html}/shape_map.d.ts +5 -5
- package/dist/{html → module/html}/sparkline.d.ts +5 -5
- package/dist/{html → module/html}/table.d.ts +3 -3
- package/dist/{html → module/html}/text.d.ts +4 -4
- package/dist/{html → module/html}/unsupported.d.ts +4 -4
- package/dist/{html → module/html}/utils.d.ts +3 -3
- package/dist/{html → module/html}/vega_spec.d.ts +5 -5
- package/dist/module/index.d.ts +11 -0
- package/dist/module/index.mjs +34772 -33684
- package/dist/module/index.umd.js +606 -579
- package/dist/module/plugins/bar-chart/bar-chart-plugin.d.ts +16 -0
- package/dist/module/plugins/bar-chart/bar-chart-settings.d.ts +49 -0
- package/dist/module/plugins/bar-chart/generate-bar_chart-vega-spec.d.ts +4 -0
- package/dist/module/plugins/bar-chart/get-bar_chart-settings.d.ts +5 -0
- package/dist/module/plugins/bar-chart/settings-to-tag.d.ts +3 -0
- package/dist/module/plugins/dummy-dom-plugin.d.ts +8 -0
- package/dist/module/plugins/dummy-plugin.d.ts +8 -0
- package/dist/module/plugins/error/error-plugin.d.ts +4 -0
- package/dist/module/plugins/index.d.ts +4 -0
- package/dist/module/plugins/line-chart/generate-line_chart-vega-spec.d.ts +17 -0
- package/dist/module/plugins/line-chart/get-line_chart-settings.d.ts +5 -0
- package/dist/module/plugins/line-chart/line-chart-plugin.d.ts +21 -0
- package/dist/module/plugins/line-chart/line-chart-settings.d.ts +52 -0
- package/dist/module/plugins/line-chart/settings-to-tag.d.ts +3 -0
- package/dist/module/registry/types.d.ts +15 -0
- package/dist/module/render-field-metadata.d.ts +20 -0
- package/dist/{stories → module/stories}/themes.stories.d.ts +1 -2
- package/dist/{stories → module/stories}/util.d.ts +4 -4
- package/dist/{stories → module/stories}/vega-config-override.stories.d.ts +1 -2
- package/dist/module/stories/wrapped-table.stories.d.ts +9 -0
- package/dist/{util.d.ts → module/util.d.ts} +11 -4
- package/package.json +10 -10
- package/test/mocks/cssMock.js +1 -0
- package/{vite.config.base.ts → vite.config.base.mts} +11 -1
- package/{vite.config.ts → vite.config.mts} +1 -1
- package/dist/component/bar-chart/generate-bar_chart-vega-spec.d.ts +0 -4
- package/dist/component/line-chart/generate-line_chart-vega-spec.d.ts +0 -4
- package/dist/component/line-chart/get-line_chart-settings.d.ts +0 -11
- package/dist/component/render-numeric-field.d.ts +0 -2
- package/dist/component/result-context.d.ts +0 -4
- package/dist/data_tree/plugins.d.ts +0 -14
- package/dist/index.d.ts +0 -7
- package/dist/plugins/line-chart-series-plugin.d.ts +0 -7
- package/dist/render-field-metadata.d.ts +0 -33
- /package/dist/{component → module/component}/chart/debug_icon.d.ts +0 -0
- /package/dist/{component → module/component}/default-settings.d.ts +0 -0
- /package/dist/{component → module/component}/error-message/error-message.d.ts +0 -0
- /package/dist/{component → module/component}/vega/merge-vega-configs.d.ts +0 -0
- /package/dist/{component → module/component}/vega/vega-expr-addons.d.ts +0 -0
- /package/dist/{html → module/html}/index.d.ts +0 -0
- /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,31 @@ 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
|
+
onDrill: console.log,
|
|
172
|
+
tableConfig: {
|
|
173
|
+
enableDrill: true,
|
|
174
|
+
},
|
|
175
|
+
});
|
|
165
176
|
const viz = renderer.createViz({
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
console.log("Malloy render error", error);
|
|
170
|
-
}
|
|
177
|
+
onError: error => {
|
|
178
|
+
console.log('Malloy render error', error);
|
|
179
|
+
},
|
|
171
180
|
});
|
|
172
181
|
viz.setResult(context.loaded['result']);
|
|
173
|
-
|
|
182
|
+
const metadata = viz.getMetadata();
|
|
183
|
+
console.group('MalloyViz metadata');
|
|
184
|
+
console.log('initial state', metadata);
|
|
185
|
+
console.log('render properties', metadata.getFieldEntry(metadata.rootField.key).renderProperties);
|
|
186
|
+
const plugin = viz.getActivePlugin(metadata.rootField.key);
|
|
187
|
+
console.log('plugin', plugin, plugin?.getSettings());
|
|
188
|
+
const tag = plugin?.settingsToTag(plugin?.getSettings());
|
|
189
|
+
console.log('tag', tag, tag?.toString());
|
|
190
|
+
console.groupEnd();
|
|
174
191
|
viz.render(targetElement);
|
|
175
192
|
|
|
176
193
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
2
|
-
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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
|
|
2
|
-
import
|
|
1
|
+
import { MalloyVegaDataRecord } from '../types';
|
|
2
|
+
import { NestField } from '../../data_tree';
|
|
3
3
|
type CustomTooltipGetterOptions = {
|
|
4
4
|
explore: NestField;
|
|
5
5
|
records: MalloyVegaDataRecord[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RendererProps } from './types';
|
|
2
2
|
export declare function renderImage(props: RendererProps): import("solid-js").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
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
|
|
1
|
+
import { RendererProps } from './types';
|
|
2
2
|
export declare function renderList(props: RendererProps): "∅" | import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RenderTimeStringOptions } from '../util';
|
|
2
|
+
import { Field } from '../data_tree';
|
|
3
|
+
export declare function renderNumericField(f: Field, value: number | null | undefined): string;
|
|
4
|
+
export declare function renderDateTimeField(f: Field, value: Date | null | undefined, options?: RenderTimeStringOptions): string;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
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
|
|
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
|
|
1
|
+
import { RendererProps } from './types';
|
|
2
2
|
export declare function renderTime({ dataColumn }: RendererProps): string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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;
|
|
@@ -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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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
|
|
2
|
-
import {
|
|
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(
|
|
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
|
|
2
|
-
import
|
|
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
|
|
2
|
-
import
|
|
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,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 {
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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
|
|
2
|
-
import {
|
|
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
|
|
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
|
|
2
|
-
import
|
|
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
|
|
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
|
|
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
|
|
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;
|