@malloydata/render 0.0.330 → 0.0.331
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/registered_data.json +1 -1
- package/dist/module/component/render-numeric-field.d.ts +22 -2
- package/dist/module/data_tree/cells/atomic.d.ts +2 -7
- package/dist/module/index.mjs +23195 -22581
- package/dist/module/index.umd.js +598 -343
- package/dist/module/plugins/big-value/big-value-component.d.ts +17 -0
- package/dist/module/plugins/big-value/big-value-plugin.d.ts +42 -0
- package/dist/module/plugins/big-value/big-value-settings.d.ts +46 -0
- package/dist/module/plugins/big-value/index.d.ts +2 -0
- package/dist/module/plugins/big-value/settings-to-tag.d.ts +3 -0
- package/dist/module/plugins/index.d.ts +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Field, NestCell } from '../../data_tree';
|
|
2
|
+
import { BigValueSettings } from './big-value-settings';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the BigValueComponent
|
|
5
|
+
*/
|
|
6
|
+
export interface BigValueComponentProps {
|
|
7
|
+
/** The data cell containing the row(s) */
|
|
8
|
+
dataColumn: NestCell;
|
|
9
|
+
/** Field metadata */
|
|
10
|
+
field: Field;
|
|
11
|
+
/** Plugin settings */
|
|
12
|
+
settings: BigValueSettings;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Main Big Value component
|
|
16
|
+
*/
|
|
17
|
+
export declare function BigValueComponent(props: BigValueComponentProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { RenderPluginFactory, CoreVizPluginInstance } from '../../api/plugin-types';
|
|
2
|
+
import { NestField } from '../../data_tree';
|
|
3
|
+
import { BigValueSettings } from './big-value-settings';
|
|
4
|
+
/**
|
|
5
|
+
* Metadata returned by the Big Value plugin
|
|
6
|
+
*/
|
|
7
|
+
interface BigValuePluginMetadata {
|
|
8
|
+
type: 'big_value';
|
|
9
|
+
field: NestField;
|
|
10
|
+
settings: BigValueSettings;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Big Value plugin instance type
|
|
14
|
+
* Extends CoreVizPluginInstance for storybook compatibility
|
|
15
|
+
*/
|
|
16
|
+
export interface BigValuePluginInstance extends CoreVizPluginInstance<BigValuePluginMetadata> {
|
|
17
|
+
field: NestField;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Big Value Plugin Factory
|
|
21
|
+
*
|
|
22
|
+
* Renders aggregate values as prominent metric cards.
|
|
23
|
+
*
|
|
24
|
+
* Usage in Malloy:
|
|
25
|
+
* # big_value
|
|
26
|
+
* run: my_source -> {
|
|
27
|
+
* aggregate:
|
|
28
|
+
* opportunity_count
|
|
29
|
+
* total_revenue
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* With comparison values:
|
|
33
|
+
* # big_value
|
|
34
|
+
* run: my_source -> {
|
|
35
|
+
* aggregate:
|
|
36
|
+
* opportunity_win_rate_ytd
|
|
37
|
+
* # big_value { comparison_field='opportunity_win_rate_ytd' comparison_label='vs Prior Year' comparison_format='ppt' }
|
|
38
|
+
* opportunity_win_rate_prior_year
|
|
39
|
+
* }
|
|
40
|
+
*/
|
|
41
|
+
export declare const BigValuePluginFactory: RenderPluginFactory<BigValuePluginInstance>;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { JSONSchemaObject } from '../../api/json-schema-types';
|
|
2
|
+
/**
|
|
3
|
+
* Size preset for big value cards
|
|
4
|
+
*/
|
|
5
|
+
export type BigValueSize = 'sm' | 'md' | 'lg';
|
|
6
|
+
/**
|
|
7
|
+
* Comparison format type
|
|
8
|
+
* - 'pct': Percentage change (e.g., +5.2%)
|
|
9
|
+
* - 'ppt': Percentage point difference (e.g., +5.0 ppt)
|
|
10
|
+
*/
|
|
11
|
+
export type ComparisonFormat = 'pct' | 'ppt';
|
|
12
|
+
/**
|
|
13
|
+
* Settings for the Big Value plugin
|
|
14
|
+
*/
|
|
15
|
+
export interface BigValueSettings extends Record<string, unknown> {
|
|
16
|
+
/** Size preset for the cards */
|
|
17
|
+
size: BigValueSize;
|
|
18
|
+
/** Threshold below which delta values are considered neutral (default: 0.05) */
|
|
19
|
+
neutralThreshold: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Comparison information extracted from field tags
|
|
23
|
+
* Used when a field has # big_value { comparison_field=... }
|
|
24
|
+
*/
|
|
25
|
+
export interface BigValueComparisonInfo {
|
|
26
|
+
/** The field name of the primary metric this comparison refers to */
|
|
27
|
+
comparisonField: string;
|
|
28
|
+
/** Optional label shown next to the delta (e.g., 'vs Prior Year') */
|
|
29
|
+
comparisonLabel?: string;
|
|
30
|
+
/** Format for the comparison: 'pct' for percentage change, 'ppt' for percentage points */
|
|
31
|
+
comparisonFormat: ComparisonFormat;
|
|
32
|
+
/** If true, a decrease is shown as positive (green) instead of negative */
|
|
33
|
+
downIsGood: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Default settings for the Big Value plugin
|
|
37
|
+
*/
|
|
38
|
+
export declare const defaultBigValueSettings: BigValueSettings;
|
|
39
|
+
/**
|
|
40
|
+
* JSON Schema for Big Value settings
|
|
41
|
+
*/
|
|
42
|
+
export declare const bigValueSettingsSchema: JSONSchemaObject;
|
|
43
|
+
/**
|
|
44
|
+
* Type for the settings schema
|
|
45
|
+
*/
|
|
46
|
+
export type IBigValueSettingsSchema = typeof bigValueSettingsSchema;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { BigValuePluginFactory, type BigValuePluginInstance, } from './big-value-plugin';
|
|
2
|
+
export { type BigValueSettings, type BigValueComparisonInfo, type ComparisonFormat, type BigValueSize, defaultBigValueSettings, bigValueSettingsSchema, type IBigValueSettingsSchema, } from './big-value-settings';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { type ILineChartSettingsSchema, lineChartSettingsSchema, defaultLineChartSettings, type LineChartSettings, } from './line-chart/line-chart-settings';
|
|
2
2
|
export { type IBarChartSettingsSchema, barChartSettingsSchema, defaultBarChartSettings, type BarChartSettings, } from './bar-chart/bar-chart-settings';
|
|
3
3
|
export { BarChartPluginFactory, type BarChartPluginInstance, } from './bar-chart/bar-chart-plugin';
|
|
4
|
+
export { BigValuePluginFactory, type BigValuePluginInstance, type BigValueSettings, type BigValueComparisonInfo, type ComparisonFormat, type BigValueSize, defaultBigValueSettings, bigValueSettingsSchema, type IBigValueSettingsSchema, } from './big-value';
|
|
4
5
|
export { ErrorPlugin } from './error/error-plugin';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/render",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.331",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/module/index.umd.js",
|
|
6
6
|
"types": "dist/module/index.d.ts",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"generate-flow": "ts-node ../../scripts/gen-flow.ts"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@malloydata/malloy": "0.0.
|
|
33
|
-
"@malloydata/malloy-interfaces": "0.0.
|
|
34
|
-
"@malloydata/malloy-tag": "0.0.
|
|
32
|
+
"@malloydata/malloy": "0.0.331",
|
|
33
|
+
"@malloydata/malloy-interfaces": "0.0.331",
|
|
34
|
+
"@malloydata/malloy-tag": "0.0.331",
|
|
35
35
|
"@tanstack/solid-virtual": "^3.10.4",
|
|
36
36
|
"lodash": "^4.17.20",
|
|
37
37
|
"luxon": "^3.5.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"vega-lite": "^5.2.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@malloydata/db-duckdb": "0.0.
|
|
46
|
+
"@malloydata/db-duckdb": "0.0.331",
|
|
47
47
|
"@storybook/addon-essentials": "^8.5.8",
|
|
48
48
|
"@storybook/addon-interactions": "^8.5.8",
|
|
49
49
|
"@storybook/addon-links": "^8.5.8",
|