@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
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RenderPluginFactory, CoreVizPluginInstance } from '../../api/plugin-types';
|
|
2
|
+
import { Field, NestField } from '../../data_tree';
|
|
3
|
+
import { BarChartSettings } from './get-bar_chart-settings';
|
|
4
|
+
export interface BarChartPluginInstance extends CoreVizPluginInstance<BarChartPluginMetadata> {
|
|
5
|
+
getTopNSeries?: (maxSeries: number) => (string | number | boolean)[];
|
|
6
|
+
field: NestField;
|
|
7
|
+
syntheticSeriesField?: Field;
|
|
8
|
+
hasMultipleSeriesFields?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface BarChartPluginMetadata {
|
|
11
|
+
type: 'bar';
|
|
12
|
+
field: NestField;
|
|
13
|
+
settings: BarChartSettings;
|
|
14
|
+
}
|
|
15
|
+
export declare const BarChartPluginFactory: RenderPluginFactory<BarChartPluginInstance>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Channel, SeriesChannel, YChannel } from '../../component/types';
|
|
2
|
+
import { JSONSchemaObject, JSONSchemaArray, JSONSchemaString, JSONSchemaBoolean, JSONSchemaOneOf } from '../../api/json-schema-types';
|
|
3
|
+
export interface BarChartSettings extends Record<string, unknown> {
|
|
4
|
+
xChannel: Channel;
|
|
5
|
+
yChannel: YChannel;
|
|
6
|
+
seriesChannel: SeriesChannel;
|
|
7
|
+
isStack: boolean;
|
|
8
|
+
interactive: boolean;
|
|
9
|
+
hideReferences: boolean;
|
|
10
|
+
disableEmbedded: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const defaultBarChartSettings: BarChartSettings;
|
|
13
|
+
export interface IBarChartSettingsSchema extends JSONSchemaObject {
|
|
14
|
+
properties: {
|
|
15
|
+
xChannel: JSONSchemaObject & {
|
|
16
|
+
properties: {
|
|
17
|
+
fields: JSONSchemaArray & {
|
|
18
|
+
items: JSONSchemaString;
|
|
19
|
+
};
|
|
20
|
+
type: JSONSchemaString;
|
|
21
|
+
independent: JSONSchemaString;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
yChannel: JSONSchemaObject & {
|
|
25
|
+
properties: {
|
|
26
|
+
fields: JSONSchemaArray & {
|
|
27
|
+
items: JSONSchemaString;
|
|
28
|
+
};
|
|
29
|
+
type: JSONSchemaString;
|
|
30
|
+
independent: JSONSchemaBoolean;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
seriesChannel: JSONSchemaObject & {
|
|
34
|
+
properties: {
|
|
35
|
+
fields: JSONSchemaArray & {
|
|
36
|
+
items: JSONSchemaString;
|
|
37
|
+
};
|
|
38
|
+
type: JSONSchemaString;
|
|
39
|
+
independent: JSONSchemaString;
|
|
40
|
+
limit: JSONSchemaOneOf;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
isStack: JSONSchemaBoolean;
|
|
44
|
+
interactive: JSONSchemaBoolean;
|
|
45
|
+
hideReferences: JSONSchemaBoolean;
|
|
46
|
+
disableEmbedded: JSONSchemaBoolean;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export declare const barChartSettingsSchema: IBarChartSettingsSchema;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { VegaChartProps } from '../../component/types';
|
|
2
|
+
import { RenderMetadata } from '../../component/render-result-metadata';
|
|
3
|
+
import { BarChartPluginInstance } from './bar-chart-plugin';
|
|
4
|
+
export declare function generateBarChartVegaSpecV2(metadata: RenderMetadata, plugin: BarChartPluginInstance): VegaChartProps;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Tag } from '@malloydata/malloy-tag';
|
|
2
|
+
import { NestField } from '../../data_tree';
|
|
3
|
+
import { BarChartSettings } from './bar-chart-settings';
|
|
4
|
+
export type { BarChartSettings };
|
|
5
|
+
export declare function getBarChartSettings(explore: NestField, tagOverride?: Tag): BarChartSettings;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RenderPluginFactory, DOMRenderPluginInstance } from '../api/plugin-types';
|
|
2
|
+
interface DummyDOMPluginMetadata {
|
|
3
|
+
type: 'dummy_dom';
|
|
4
|
+
fieldName: string;
|
|
5
|
+
}
|
|
6
|
+
type DummyDOMPluginInstance = DOMRenderPluginInstance<DummyDOMPluginMetadata>;
|
|
7
|
+
export declare const DummyDOMPluginFactory: RenderPluginFactory<DummyDOMPluginInstance>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RenderPluginFactory, SolidJSRenderPluginInstance } from '../api/plugin-types';
|
|
2
|
+
interface DummyPluginMetadata {
|
|
3
|
+
type: 'dummy';
|
|
4
|
+
fieldName: string;
|
|
5
|
+
}
|
|
6
|
+
type DummyPluginInstance = SolidJSRenderPluginInstance<DummyPluginMetadata>;
|
|
7
|
+
export declare const DummyPluginFactory: RenderPluginFactory<DummyPluginInstance>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { type ILineChartSettingsSchema, lineChartSettingsSchema, defaultLineChartSettings, type LineChartSettings, } from './line-chart/line-chart-settings';
|
|
2
|
+
export { type IBarChartSettingsSchema, barChartSettingsSchema, defaultBarChartSettings, type BarChartSettings, } from './bar-chart/bar-chart-settings';
|
|
3
|
+
export { BarChartPluginFactory, type BarChartPluginInstance, } from './bar-chart/bar-chart-plugin';
|
|
4
|
+
export { ErrorPlugin } from './error/error-plugin';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { VegaChartProps } from '../../component/types';
|
|
2
|
+
import { RenderMetadata } from '../../component/render-result-metadata';
|
|
3
|
+
import { LineChartPluginInstance } from './line-chart-plugin';
|
|
4
|
+
export interface LineChartSettings {
|
|
5
|
+
xChannel: {
|
|
6
|
+
fields: string[];
|
|
7
|
+
};
|
|
8
|
+
yChannel: {
|
|
9
|
+
fields: string[];
|
|
10
|
+
};
|
|
11
|
+
seriesChannel: {
|
|
12
|
+
fields: string[];
|
|
13
|
+
};
|
|
14
|
+
zeroBaseline: boolean;
|
|
15
|
+
interactive: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function generateLineChartVegaSpecV2(metadata: RenderMetadata, plugin: LineChartPluginInstance): VegaChartProps;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Tag } from '@malloydata/malloy-tag';
|
|
2
|
+
import { NestField } from '../../data_tree';
|
|
3
|
+
import { LineChartSettings, LineChartPluginOptions } from './line-chart-settings';
|
|
4
|
+
export type { LineChartSettings, LineChartPluginOptions };
|
|
5
|
+
export declare function getLineChartSettings(explore: NestField, tagOverride?: Tag, jsDefaults?: Partial<LineChartSettings>, modelTag?: Tag): LineChartSettings;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RenderPluginFactory, CoreVizPluginInstance } from '../../api/plugin-types';
|
|
2
|
+
import { Field, NestField } from '../../data_tree';
|
|
3
|
+
import { LineChartSettings } from './get-line_chart-settings';
|
|
4
|
+
interface LineChartPluginMetadata {
|
|
5
|
+
type: 'line';
|
|
6
|
+
field: NestField;
|
|
7
|
+
settings: LineChartSettings;
|
|
8
|
+
}
|
|
9
|
+
interface SeriesStats {
|
|
10
|
+
sum: number;
|
|
11
|
+
count: number;
|
|
12
|
+
avg: number;
|
|
13
|
+
}
|
|
14
|
+
interface LineChartPluginInstance extends CoreVizPluginInstance<LineChartPluginMetadata> {
|
|
15
|
+
field: NestField;
|
|
16
|
+
seriesStats: Map<string, SeriesStats>;
|
|
17
|
+
getTopNSeries: (maxSeries: number) => (string | number | boolean)[];
|
|
18
|
+
syntheticSeriesField?: Field;
|
|
19
|
+
}
|
|
20
|
+
export declare const LineChartPluginFactory: RenderPluginFactory<LineChartPluginInstance>;
|
|
21
|
+
export type { LineChartPluginInstance };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Channel, SeriesChannel, YChannel } from '../../component/types';
|
|
2
|
+
import { JSONSchemaObject, JSONSchemaArray, JSONSchemaString, JSONSchemaBoolean, JSONSchemaOneOf, JSONSchemaFieldString } from '../../api/json-schema-types';
|
|
3
|
+
export interface LineChartSettings extends Record<string, unknown> {
|
|
4
|
+
xChannel: Channel;
|
|
5
|
+
yChannel: YChannel;
|
|
6
|
+
seriesChannel: SeriesChannel;
|
|
7
|
+
zeroBaseline: boolean;
|
|
8
|
+
interactive: boolean;
|
|
9
|
+
disableEmbedded: boolean;
|
|
10
|
+
mode?: 'yoy' | 'normal';
|
|
11
|
+
}
|
|
12
|
+
export interface LineChartPluginOptions {
|
|
13
|
+
defaults?: Partial<LineChartSettings>;
|
|
14
|
+
}
|
|
15
|
+
export declare const defaultLineChartSettings: LineChartSettings;
|
|
16
|
+
export interface ILineChartSettingsSchema extends JSONSchemaObject {
|
|
17
|
+
properties: {
|
|
18
|
+
xChannel: JSONSchemaObject & {
|
|
19
|
+
properties: {
|
|
20
|
+
fields: JSONSchemaArray & {
|
|
21
|
+
items: JSONSchemaFieldString;
|
|
22
|
+
};
|
|
23
|
+
type: JSONSchemaString;
|
|
24
|
+
independent: JSONSchemaString;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
yChannel: JSONSchemaObject & {
|
|
28
|
+
properties: {
|
|
29
|
+
fields: JSONSchemaArray & {
|
|
30
|
+
items: JSONSchemaFieldString;
|
|
31
|
+
};
|
|
32
|
+
type: JSONSchemaString;
|
|
33
|
+
independent: JSONSchemaBoolean;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
seriesChannel: JSONSchemaObject & {
|
|
37
|
+
properties: {
|
|
38
|
+
fields: JSONSchemaArray & {
|
|
39
|
+
items: JSONSchemaFieldString;
|
|
40
|
+
};
|
|
41
|
+
type: JSONSchemaString;
|
|
42
|
+
independent: JSONSchemaString;
|
|
43
|
+
limit: JSONSchemaOneOf;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
zeroBaseline: JSONSchemaBoolean;
|
|
47
|
+
interactive: JSONSchemaBoolean;
|
|
48
|
+
disableEmbedded: JSONSchemaBoolean;
|
|
49
|
+
mode: JSONSchemaString;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export declare const lineChartSettingsSchema: ILineChartSettingsSchema;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Field } from '../data_tree';
|
|
2
|
+
import { RenderPluginInstance } from '../api/plugin-types';
|
|
3
|
+
export type RenderFieldProps<T = unknown> = {
|
|
4
|
+
field: Field;
|
|
5
|
+
renderAs: string;
|
|
6
|
+
sizingStrategy: string;
|
|
7
|
+
properties: T;
|
|
8
|
+
errors: Error[];
|
|
9
|
+
};
|
|
10
|
+
export type RenderFieldRegistryEntry = {
|
|
11
|
+
field: Field;
|
|
12
|
+
renderProperties: RenderFieldProps;
|
|
13
|
+
plugins: RenderPluginInstance[];
|
|
14
|
+
};
|
|
15
|
+
export type RenderFieldRegistry = Map<string, RenderFieldRegistryEntry>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Field, RootField } from './data_tree';
|
|
2
|
+
import { RenderPluginFactory, RenderPluginInstance } from './api/plugin-types';
|
|
3
|
+
import { RenderFieldRegistryEntry } from './registry/types';
|
|
4
|
+
import type * as Malloy from '@malloydata/malloy-interfaces';
|
|
5
|
+
export type OnPluginCreateError = (error: Error, factory: RenderPluginFactory, field: Field, plugins: RenderPluginInstance[]) => void;
|
|
6
|
+
export declare class RenderFieldMetadata {
|
|
7
|
+
private pluginRegistry;
|
|
8
|
+
private pluginOptions;
|
|
9
|
+
private onPluginCreateError?;
|
|
10
|
+
private registry;
|
|
11
|
+
private rootField;
|
|
12
|
+
constructor(result: Malloy.Result, pluginRegistry?: RenderPluginFactory[], pluginOptions?: Record<string, unknown>, onPluginCreateError?: OnPluginCreateError | undefined);
|
|
13
|
+
private instantiatePluginsForField;
|
|
14
|
+
private registerFields;
|
|
15
|
+
private populateRenderFieldProperties;
|
|
16
|
+
getAllFields(): Field[];
|
|
17
|
+
getRootField(): RootField;
|
|
18
|
+
getPluginsForField(fieldKey: string): RenderPluginInstance[];
|
|
19
|
+
getFieldEntry(fieldKey: string): RenderFieldRegistryEntry | undefined;
|
|
20
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { LoaderFunction, Args } from '@storybook/types';
|
|
2
|
+
import { HtmlRenderer } from '@storybook/html';
|
|
3
|
+
import { DuckDBWASMConnection } from '@malloydata/db-duckdb/wasm';
|
|
4
4
|
import type * as Malloy from '@malloydata/malloy-interfaces';
|
|
5
5
|
export type QueryOptions = {
|
|
6
6
|
script: string;
|
|
@@ -12,7 +12,7 @@ export declare function createLoader(script: string): LoaderFunction<HtmlRendere
|
|
|
12
12
|
export declare function loadModel({ script, connection, }: {
|
|
13
13
|
script: string;
|
|
14
14
|
connection: Promise<DuckDBWASMConnection>;
|
|
15
|
-
}): Promise<import(
|
|
15
|
+
}): Promise<import('@malloydata/malloy').ModelMaterializer>;
|
|
16
16
|
export declare function runQuery({ script, source, view, connection, }: QueryOptions): Promise<Malloy.Result>;
|
|
17
17
|
type RenderOptions = QueryOptions & {
|
|
18
18
|
classes?: '';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type * as Malloy from '@malloydata/malloy-interfaces';
|
|
2
1
|
import { Tag } from '@malloydata/malloy-tag';
|
|
3
2
|
import { DurationUnit } from './html/data_styles';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import { Cell, NestField, Field } from './data_tree';
|
|
4
|
+
import type * as Malloy from '@malloydata/malloy-interfaces';
|
|
6
5
|
export declare const NULL_SYMBOL = "\u2205";
|
|
6
|
+
type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
7
|
+
export declare function deepMerge<T extends Record<string, unknown>[]>(...sources: [...T]): UnionToIntersection<T[number]>;
|
|
7
8
|
export declare function tagFromAnnotations(annotations: Malloy.Annotation[] | undefined, prefix?: string): Tag;
|
|
8
9
|
export declare function renderTagFromAnnotations(annotations: Malloy.Annotation[] | undefined): Tag;
|
|
9
10
|
export declare function getTextWidthCanvas(text: string, font: string, canvasToUse?: HTMLCanvasElement): number;
|
|
@@ -17,7 +18,13 @@ export declare function formatTimeUnit(value: number, unit: DurationUnit, option
|
|
|
17
18
|
export declare function getText(field: Field, value: number, options: {
|
|
18
19
|
durationUnit?: string;
|
|
19
20
|
}): string | null;
|
|
20
|
-
export
|
|
21
|
+
export interface RenderTimeStringOptions {
|
|
22
|
+
isDate?: boolean;
|
|
23
|
+
timeframe?: string;
|
|
24
|
+
extractFormat?: 'month-day' | 'quarter' | 'month' | 'week' | 'day';
|
|
25
|
+
}
|
|
26
|
+
export declare function renderTimeString(value: Date, options?: RenderTimeStringOptions): string;
|
|
21
27
|
export declare function valueToMalloy(value: Cell): string;
|
|
22
28
|
export declare function walkFields(e: NestField, cb: (f: Field) => void): void;
|
|
23
29
|
export declare function notUndefined<T>(x: T | undefined): x is T;
|
|
30
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/render",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.295",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/module/index.umd.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,26 +14,24 @@
|
|
|
14
14
|
},
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
|
-
"types": "./dist/index.d.ts",
|
|
17
|
+
"types": "./dist/module/index.d.ts",
|
|
18
18
|
"default": "./dist/module/index.umd.js"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"test": "jest --config=../../jest.config.js",
|
|
23
|
-
"build": "npm run build-types && npm run build-source",
|
|
24
23
|
"clean": "tsc --build --clean",
|
|
25
24
|
"prepublishOnly": "npm run build",
|
|
26
25
|
"storybook": "rm -rf ./node_modules/.cache && storybook dev -p 6006",
|
|
27
26
|
"storybook-windows": "del /s /q .\\node_modules\\.cache && storybook dev -p 6006",
|
|
28
27
|
"build-storybook": "storybook build",
|
|
29
|
-
"build
|
|
30
|
-
"build-types": "tsc --build --declaration --emitDeclarationOnly",
|
|
28
|
+
"build": "vite build --outDir 'dist/module' --config vite.config.mts",
|
|
31
29
|
"generate-flow": "ts-node ../../scripts/gen-flow.ts"
|
|
32
30
|
},
|
|
33
31
|
"dependencies": {
|
|
34
|
-
"@malloydata/malloy": "0.0.
|
|
35
|
-
"@malloydata/malloy-interfaces": "0.0.
|
|
36
|
-
"@malloydata/malloy-tag": "0.0.
|
|
32
|
+
"@malloydata/malloy": "0.0.295",
|
|
33
|
+
"@malloydata/malloy-interfaces": "0.0.295",
|
|
34
|
+
"@malloydata/malloy-tag": "0.0.295",
|
|
37
35
|
"@tanstack/solid-virtual": "^3.10.4",
|
|
38
36
|
"lodash": "^4.17.20",
|
|
39
37
|
"luxon": "^2.4.0",
|
|
@@ -44,7 +42,7 @@
|
|
|
44
42
|
"vega-lite": "^5.2.0"
|
|
45
43
|
},
|
|
46
44
|
"devDependencies": {
|
|
47
|
-
"@malloydata/db-duckdb": "0.0.
|
|
45
|
+
"@malloydata/db-duckdb": "0.0.295",
|
|
48
46
|
"@storybook/addon-essentials": "^8.5.8",
|
|
49
47
|
"@storybook/addon-interactions": "^8.5.8",
|
|
50
48
|
"@storybook/addon-links": "^8.5.8",
|
|
@@ -60,6 +58,8 @@
|
|
|
60
58
|
"esbuild": "0.19.11",
|
|
61
59
|
"storybook": "^8.5.8",
|
|
62
60
|
"vite": "^5.1.5",
|
|
63
|
-
"vite-plugin-
|
|
61
|
+
"vite-plugin-dts": "^4.5.4",
|
|
62
|
+
"vite-plugin-solid": "^2.10.1",
|
|
63
|
+
"vite-tsconfig-paths": "^5.1.4"
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = '';
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import type {PluginOption} from 'vite';
|
|
2
2
|
import {defineConfig} from 'vite';
|
|
3
3
|
import solidPlugin from 'vite-plugin-solid';
|
|
4
|
+
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
5
|
+
import dts from 'vite-plugin-dts';
|
|
4
6
|
import path from 'path';
|
|
5
7
|
|
|
6
8
|
export default defineConfig({
|
|
7
|
-
plugins: [
|
|
9
|
+
plugins: [
|
|
10
|
+
viteStripMalloyDevToolsPlugin(),
|
|
11
|
+
solidPlugin(),
|
|
12
|
+
tsconfigPaths(),
|
|
13
|
+
dts({
|
|
14
|
+
insertTypesEntry: true,
|
|
15
|
+
}),
|
|
16
|
+
],
|
|
8
17
|
optimizeDeps: {
|
|
9
18
|
include: ['@malloydata/malloy'],
|
|
10
19
|
},
|
|
@@ -21,6 +30,7 @@ export default defineConfig({
|
|
|
21
30
|
commonjsOptions: {
|
|
22
31
|
include: [/malloy/, /node_modules/],
|
|
23
32
|
},
|
|
33
|
+
sourcemap: process.env.NODE_ENV === 'development',
|
|
24
34
|
},
|
|
25
35
|
define: {
|
|
26
36
|
'process.env': {},
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { VegaChartProps } from '../types';
|
|
2
|
-
import type { RepeatedRecordField } from '../../data_tree';
|
|
3
|
-
import type { RenderMetadata } from '../render-result-metadata';
|
|
4
|
-
export declare function generateBarChartVegaSpec(explore: RepeatedRecordField, metadata: RenderMetadata): VegaChartProps;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { VegaChartProps } from '../types';
|
|
2
|
-
import type { NestField } from '../../data_tree';
|
|
3
|
-
import type { RenderMetadata } from '../render-result-metadata';
|
|
4
|
-
export declare function generateLineChartVegaSpec(explore: NestField, metadata: RenderMetadata): VegaChartProps;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Tag } from '@malloydata/malloy-tag';
|
|
2
|
-
import type { Channel } from '../types';
|
|
3
|
-
import type { NestField } from '../../data_tree';
|
|
4
|
-
export type LineChartSettings = {
|
|
5
|
-
xChannel: Channel;
|
|
6
|
-
yChannel: Channel;
|
|
7
|
-
seriesChannel: Channel;
|
|
8
|
-
zeroBaseline: boolean;
|
|
9
|
-
interactive: boolean;
|
|
10
|
-
};
|
|
11
|
-
export declare function getLineChartSettings(explore: NestField, tagOverride?: Tag): LineChartSettings;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Accessor } from 'solid-js';
|
|
2
|
-
import type { RenderMetadata } from './render-result-metadata';
|
|
3
|
-
export declare const ResultContext: import("solid-js").Context<Accessor<RenderMetadata> | undefined>;
|
|
4
|
-
export declare const useResultContext: () => RenderMetadata;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Tag } from '@malloydata/malloy-tag';
|
|
2
|
-
import type { Field, NestField } from './fields';
|
|
3
|
-
import type { NestCell } from './cells';
|
|
4
|
-
import type { FieldType } from './types';
|
|
5
|
-
export type RenderPluginInstance = {
|
|
6
|
-
name: string;
|
|
7
|
-
processData(field: NestField, cell: NestCell): void;
|
|
8
|
-
};
|
|
9
|
-
export type RenderPlugin<T extends RenderPluginInstance = RenderPluginInstance> = {
|
|
10
|
-
name: string;
|
|
11
|
-
matches: (fieldTag: Tag, fieldType: FieldType) => boolean;
|
|
12
|
-
plugin: RenderPluginFactory<T>;
|
|
13
|
-
};
|
|
14
|
-
export type RenderPluginFactory<T extends RenderPluginInstance> = (field: Field) => T;
|
package/dist/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { HTMLView, JSONView } from './html/html_view';
|
|
2
|
-
export * from './html/data_styles';
|
|
3
|
-
export type { MalloyRenderProps } from './component/render';
|
|
4
|
-
export { MalloyRenderer } from '@/api/malloy-renderer';
|
|
5
|
-
export type { MalloyViz } from '@/api/malloy-viz';
|
|
6
|
-
export type { MalloyRendererOptions, RenderFieldMetadata } from '@/api/types';
|
|
7
|
-
export type { DrillData, MalloyClickEventPayload, TableConfig, DashboardConfig, VegaConfigHandler, } from '@/component/types';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { RenderPlugin, RenderPluginInstance } from '../data_tree';
|
|
2
|
-
type LineChartPluginInstance = {
|
|
3
|
-
getTopNSeries: (n: number) => (string | number | boolean)[];
|
|
4
|
-
} & RenderPluginInstance;
|
|
5
|
-
export declare const LineChartSeriesPluginFactory: RenderPlugin<LineChartPluginInstance>;
|
|
6
|
-
export type LineChartSeriesPluginInstance = ReturnType<typeof LineChartSeriesPluginFactory.plugin>;
|
|
7
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { type Field, RootField, RecordField, ArrayField, type NestField, RepeatedRecordField, type FieldRegistry as DataTreeFieldRegistry } from '@/data_tree';
|
|
2
|
-
import type * as Malloy from '@malloydata/malloy-interfaces';
|
|
3
|
-
type RenderFieldProps<T = unknown> = {
|
|
4
|
-
field: Field;
|
|
5
|
-
renderAs: string;
|
|
6
|
-
sizingStrategy: string;
|
|
7
|
-
properties: T;
|
|
8
|
-
errors: Error[];
|
|
9
|
-
};
|
|
10
|
-
type RenderFieldRegistryEntry = {
|
|
11
|
-
field: Field;
|
|
12
|
-
renderProperties: RenderFieldProps;
|
|
13
|
-
plugins: never[];
|
|
14
|
-
};
|
|
15
|
-
interface FieldRegistry extends DataTreeFieldRegistry {
|
|
16
|
-
rendererFields: Map<string, RenderFieldRegistryEntry>;
|
|
17
|
-
}
|
|
18
|
-
export declare class RenderFieldMetadata {
|
|
19
|
-
private registry;
|
|
20
|
-
private legacyRegistry;
|
|
21
|
-
private rootField;
|
|
22
|
-
constructor(result: Malloy.Result);
|
|
23
|
-
private registerFields;
|
|
24
|
-
private populateRenderFieldProperties;
|
|
25
|
-
getField(path: string[]): Field | undefined;
|
|
26
|
-
getAllFields(): Field[];
|
|
27
|
-
getRootField(): RootField;
|
|
28
|
-
getFieldsByType<T extends Field, F extends Malloy.DimensionInfo>(type: new (field: F, parent: NestField | undefined, registry?: FieldRegistry) => T): T[];
|
|
29
|
-
getRecordFields(): RecordField[];
|
|
30
|
-
getArrayFields(): ArrayField[];
|
|
31
|
-
getRepeatedRecordFields(): RepeatedRecordField[];
|
|
32
|
-
}
|
|
33
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|