@vizzly/dashboard 0.7.3 → 0.7.4-dev-396503edb3f72dee2437663fb8b8398a998ed90b

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 (111) hide show
  1. package/dist/charts/src/AreaChart/AreaChart.d.ts +3 -1
  2. package/dist/charts/src/BarChart/BarChart.d.ts +3 -1
  3. package/dist/charts/src/LineChart/types.d.ts +3 -1
  4. package/dist/charts/src/PieChart/CorePieChart.d.ts +1 -1
  5. package/dist/charts/src/PieChart/PieChart.d.ts +6 -0
  6. package/dist/charts/src/ScatterChart/ScatterChart.d.ts +1 -1
  7. package/dist/charts/src/XYChart/components/Threshold.d.ts +13 -0
  8. package/dist/charts/src/XYChart/components/threshold.utils.d.ts +4 -0
  9. package/dist/charts/src/XYChart/index.d.ts +0 -1
  10. package/dist/charts/src/XYChart/types.d.ts +15 -0
  11. package/dist/dashboard/src/contexts/GlobalProvider/useGlobalProvider.d.ts +24 -12
  12. package/dist/dashboard/src/sdk/types.d.ts +1 -0
  13. package/dist/dashboard/src/types.d.ts +3 -1
  14. package/dist/index.js +1 -1
  15. package/dist/results-driver/src/utils/runWithValidationAndCaching.d.ts +1 -1
  16. package/dist/shared-logic/src/AdditionalFilter/types.d.ts +1 -0
  17. package/dist/shared-logic/src/Component/sharedSchemas.d.ts +1 -0
  18. package/dist/shared-logic/src/Component/types.d.ts +8 -0
  19. package/dist/shared-logic/src/ComponentInterface/types/namespaces.types.d.ts +3 -1
  20. package/dist/shared-logic/src/DashboardAPI/types.d.ts +1 -0
  21. package/dist/shared-logic/src/DataSet/DataSet.d.ts +2 -2
  22. package/dist/shared-logic/src/DataSet/types.d.ts +1 -1
  23. package/dist/shared-logic/src/FeatureToggle/types.d.ts +1 -0
  24. package/dist/shared-logic/src/FormatPanelConfig/types.d.ts +3 -2
  25. package/dist/shared-logic/src/Headline/index.d.ts +5 -0
  26. package/dist/shared-logic/src/IdentityConfig/types.d.ts +1 -0
  27. package/dist/shared-logic/src/PDFGenerator/constants.d.ts +3 -0
  28. package/dist/shared-logic/src/PDFGenerator/converter.d.ts +36 -0
  29. package/dist/shared-logic/src/PDFGenerator/index.d.ts +17 -0
  30. package/dist/shared-logic/src/PDFGenerator/types.d.ts +91 -0
  31. package/dist/shared-logic/src/PDFGenerator/utils.d.ts +2 -0
  32. package/dist/shared-logic/src/Query/Query.d.ts +6 -2
  33. package/dist/shared-logic/src/Query/types.d.ts +7 -1
  34. package/dist/shared-logic/src/QueryEngineConfig/types.d.ts +1 -1
  35. package/dist/shared-logic/src/SQLViews/index.d.ts +11 -0
  36. package/dist/shared-logic/src/SQLViews/types.d.ts +7 -0
  37. package/dist/shared-logic/src/SimpleInsecureHash/index.d.ts +1 -0
  38. package/dist/shared-logic/src/Theme/types.d.ts +15 -0
  39. package/dist/shared-logic/src/Threshold/threshold.utils.d.ts +10 -0
  40. package/dist/shared-logic/src/Translations/translation.types.d.ts +174 -14
  41. package/dist/shared-logic/src/VizzlyConfig/validate.d.ts +2 -0
  42. package/dist/shared-logic/src/api/index.d.ts +1 -0
  43. package/dist/shared-logic/src/api/queryEngine/createSqlPreview.d.ts +1 -1
  44. package/dist/shared-logic/src/api/queryEngine/updateUser.d.ts +2 -0
  45. package/dist/shared-logic/src/api/vizzly/updateQueryEngineUser.d.ts +2 -0
  46. package/dist/shared-logic/src/utils/htmlHelper.d.ts +2 -0
  47. package/dist/shared-ui/src/base/Badge/Badge.d.ts +3 -0
  48. package/dist/shared-ui/src/base/Button/IconButton.d.ts +8 -0
  49. package/dist/shared-ui/src/base/CodeEditor/CodeEditor.d.ts +10 -2
  50. package/dist/shared-ui/src/base/CopyToClipboard/CopyButton.d.ts +3 -7
  51. package/dist/shared-ui/src/base/Dropdown/Dropdown.styles.d.ts +9 -1
  52. package/dist/shared-ui/src/base/Dropdown/Dropdown.types.d.ts +3 -0
  53. package/dist/shared-ui/src/base/Icons/SVGs.d.ts +4 -0
  54. package/dist/shared-ui/src/base/Input.d.ts +8 -1
  55. package/dist/shared-ui/src/base/Select/Wrapper.d.ts +2 -0
  56. package/dist/shared-ui/src/base/Select/useDelayedLoading.d.ts +1 -0
  57. package/dist/shared-ui/src/base/Select.d.ts +2 -0
  58. package/dist/shared-ui/src/base/StaticValue/StaticValue.d.ts +1 -0
  59. package/dist/shared-ui/src/base/ValuesContainer/buildSingleValue.d.ts +3 -1
  60. package/dist/shared-ui/src/base/layout/View.styles.d.ts +2 -0
  61. package/dist/shared-ui/src/components/AdditionalFilter/AddFilterForm.d.ts +0 -1
  62. package/dist/shared-ui/src/components/AdditionalFilter/AdditionalSingleSelectFilter/index.d.ts +1 -1
  63. package/dist/shared-ui/src/components/AdditionalFilter/DateFilter/index.d.ts +1 -1
  64. package/dist/shared-ui/src/components/AdditionalFilter/labelWidth.d.ts +2 -1
  65. package/dist/shared-ui/src/components/AreaChart/AreaChartView.d.ts +5 -2
  66. package/dist/shared-ui/src/components/AreaChart/types.d.ts +2 -1
  67. package/dist/shared-ui/src/components/BarChart/BarChartView.d.ts +4 -1
  68. package/dist/shared-ui/src/components/BarChart/types.d.ts +2 -1
  69. package/dist/shared-ui/src/components/ChartPane/{ChartWrapper.d.ts → ViewWrapper.d.ts} +1 -1
  70. package/dist/shared-ui/src/components/ComboChart/ComboChart.d.ts +2 -1
  71. package/dist/shared-ui/src/components/ComboChart/ComboChartView.d.ts +4 -1
  72. package/dist/shared-ui/src/components/HeadlineStats/HeadlineStats.d.ts +15 -0
  73. package/dist/shared-ui/src/components/HeadlineStats/HeadlineStats.test.d.ts +1 -0
  74. package/dist/shared-ui/src/components/LineChart/LineChartView.d.ts +50 -49
  75. package/dist/shared-ui/src/components/LineChart/types.d.ts +2 -1
  76. package/dist/shared-ui/src/components/PDFDownload/ComponentWrapper.d.ts +11 -0
  77. package/dist/shared-ui/src/components/PDFDownload/PDFDownloadModal.d.ts +11 -0
  78. package/dist/shared-ui/src/components/PDFDownload/generateDownloadablePDF.d.ts +10 -0
  79. package/dist/shared-ui/src/components/PieChart/PieChartView.d.ts +1 -1
  80. package/dist/shared-ui/src/components/Progress/ProgressView.d.ts +1 -1
  81. package/dist/shared-ui/src/components/ScatterChart/ScatterChart.d.ts +2 -1
  82. package/dist/shared-ui/src/components/ScatterChart/ScatterChartView.d.ts +2 -1
  83. package/dist/shared-ui/src/components/SingleStat/DeltaPills.d.ts +2 -1
  84. package/dist/shared-ui/src/components/SingleStat/SingleStatView.d.ts +20 -1
  85. package/dist/shared-ui/src/components/SingleStat/stats.func.d.ts +2 -0
  86. package/dist/shared-ui/src/components/SingleStat/useSingleStatWidth.d.ts +2 -0
  87. package/dist/shared-ui/src/components/Studio/StudioApp/Cell.d.ts +2 -0
  88. package/dist/shared-ui/src/components/Studio/StudioApp.d.ts +0 -1
  89. package/dist/shared-ui/src/components/Studio/StudioContexts.d.ts +2 -1
  90. package/dist/shared-ui/src/components/ViewHeader/ViewHeader.d.ts +2 -1
  91. package/dist/shared-ui/src/contexts/DashboardBehaviour/context.d.ts +1 -0
  92. package/dist/shared-ui/src/contexts/DashboardBehaviour/types.d.ts +3 -0
  93. package/dist/shared-ui/src/contexts/DashboardContext/context.d.ts +2 -2
  94. package/dist/shared-ui/src/contexts/DashboardContext/types.d.ts +2 -2
  95. package/dist/shared-ui/src/headlessui/hooks/use-disposables.d.ts +1 -1
  96. package/dist/shared-ui/src/headlessui/utils/disposables.d.ts +1 -1
  97. package/dist/shared-ui/src/library/Dashboard/HeaderRow.d.ts +1 -0
  98. package/dist/shared-ui/src/library/DataPanel/FilterInput/FilterInputForm.d.ts +2 -0
  99. package/dist/shared-ui/src/library/DataPanel/FilterInput/IndividualFilter.d.ts +2 -0
  100. package/dist/shared-ui/src/library/DataPanel/QueryOpInput.d.ts +6 -0
  101. package/dist/shared-ui/src/library/Editor/useEditor.d.ts +2 -2
  102. package/dist/shared-ui/src/library/Empty.d.ts +3 -0
  103. package/dist/shared-ui/src/library/ResizableRow.d.ts +1 -0
  104. package/dist/shared-ui/src/library/ResizableRowCell.d.ts +3 -2
  105. package/dist/shared-ui/src/library/StylePanel/ConditionalFormatting/ConditionalFormattingModal.d.ts +1 -0
  106. package/dist/shared-ui/src/library/StylePanel/ConditionalFormatting/ConditionalFormattingRules.d.ts +11 -1
  107. package/dist/shared-ui/src/library/StylePanel/HeadlineSection.d.ts +6 -0
  108. package/dist/shared-ui/src/predictInitialComponent.d.ts +7 -1
  109. package/dist/shared-ui/src/styles/global.styles.d.ts +41 -9
  110. package/dist/shared-ui/src/types.d.ts +2 -2
  111. package/package.json +4 -2
@@ -1,4 +1,4 @@
1
1
  import { PreparedQuery } from "../../../shared-logic/src/Query/types";
2
2
  /** A generic function to validate a list of queries, and then only run the ones which are valid. */
3
- declare const runWithValidationAndCaching: <Query, Result>(queries: (import("../../../shared-logic/src/Query/types").UniqueArrayValuesQuery | Query)[], isRunnable: (query: import("../../../shared-logic/src/Query/types").UniqueArrayValuesQuery | Query) => boolean, run: (queries: (import("../../../shared-logic/src/Query/types").UniqueArrayValuesQuery | Query)[]) => Promise<(Result | null)[] | null>, cacheKey: (query: import("../../../shared-logic/src/Query/types").UniqueArrayValuesQuery | Query) => any) => Promise<(Result | null)[] | null>;
3
+ declare const runWithValidationAndCaching: <Query, Result>(queries: (import("../../../shared-logic/src/Query/types").UniqueArrayValuesQuery | import("../../../shared-logic/src/Query/types").PreAggregatedQuery | Query)[], isRunnable: (query: import("../../../shared-logic/src/Query/types").UniqueArrayValuesQuery | import("../../../shared-logic/src/Query/types").PreAggregatedQuery | Query) => boolean, run: (queries: (import("../../../shared-logic/src/Query/types").UniqueArrayValuesQuery | import("../../../shared-logic/src/Query/types").PreAggregatedQuery | Query)[]) => Promise<(Result | null)[] | null>, cacheKey: (query: import("../../../shared-logic/src/Query/types").UniqueArrayValuesQuery | import("../../../shared-logic/src/Query/types").PreAggregatedQuery | Query) => any) => Promise<(Result | null)[] | null>;
4
4
  export default runWithValidationAndCaching;
@@ -32,6 +32,7 @@ declare type BaseAdditionalFilter<T extends AdditionalFilterType> = {
32
32
  requiresValue: boolean;
33
33
  title?: string;
34
34
  optionsFilters?: OptionalFilters;
35
+ hidden?: boolean;
35
36
  };
36
37
  declare type FixedRangeValue = {
37
38
  type: 'fixedRange';
@@ -43,6 +43,7 @@ export declare const protectedFieldsDimension: (queryEngineConfig: QueryEngineCo
43
43
  export declare const parametersSchema: (queryEngineConfig: QueryEngineConfig, attributeSchemaOptions: ComponentInterfaceConfig['attributesSchemaOptions']) => Joi.ObjectSchema<any>;
44
44
  export declare const goalLineSchema: () => Joi.ObjectSchema<any>;
45
45
  export declare const goalLinesSchema: () => Joi.ArraySchema<any[]>;
46
+ export declare const headlineSchema: () => Joi.ObjectSchema<any>;
46
47
  export declare const axisTitleSchema: () => Joi.ObjectSchema<any>;
47
48
  export declare const sizingSchema: Joi.ObjectSchema<any>;
48
49
  export declare const conditionalFormattingRulesSchema: (queryEngineConfig: QueryEngineConfig) => Joi.ArraySchema<any[]>;
@@ -60,6 +60,7 @@ export declare namespace Component {
60
60
  parameters?: Parameters;
61
61
  goalLines?: Array<Component.GoalLine.Rule>;
62
62
  axisTitles?: AxisTitles;
63
+ headline?: Headline;
63
64
  };
64
65
  export type CustomComponentAttributes = BaseAttributes & {
65
66
  type: 'custom';
@@ -69,6 +70,10 @@ export declare namespace Component {
69
70
  x?: string;
70
71
  y?: string;
71
72
  };
73
+ export type HeadlineFunction = 'mean' | 'sum' | 'current' | null;
74
+ export type Headline = {
75
+ func?: HeadlineFunction;
76
+ };
72
77
  export type HorizontalBarChartAttributes = Omit<BarChartAttributes, 'type'> & {
73
78
  type: 'horizontalBarChart';
74
79
  conditionalFormattingRules: Array<ConditionalFormatting.Rule>;
@@ -92,6 +97,7 @@ export declare namespace Component {
92
97
  goalLines?: Array<Component.GoalLine.Rule>;
93
98
  conditionalFormattingRules?: {
94
99
  bar?: Array<ConditionalFormatting.Rule>;
100
+ line?: Array<ConditionalFormatting.Rule>;
95
101
  };
96
102
  axisTitles?: AxisTitles;
97
103
  };
@@ -113,6 +119,7 @@ export declare namespace Component {
113
119
  parameters?: Parameters;
114
120
  goalLines?: Array<Component.GoalLine.Rule>;
115
121
  axisTitles?: AxisTitles;
122
+ headline?: Headline;
116
123
  };
117
124
  export type PieChartAttributes = BaseAttributes & BaseQueryAttributes & {
118
125
  type: 'pieChart';
@@ -140,6 +147,7 @@ export declare namespace Component {
140
147
  parameters?: Parameters;
141
148
  goalLines?: Array<Component.GoalLine.Rule>;
142
149
  axisTitles?: AxisTitles;
150
+ headline?: Headline;
143
151
  };
144
152
  export namespace ConditionalFormatting {
145
153
  type Rule = {
@@ -93,12 +93,14 @@ export interface FormatPanelNamespaces {
93
93
  };
94
94
  goal_line?: Section<'goalLine'>;
95
95
  map_colors?: Section<'mapColors'>;
96
+ headline?: Section<'headline'>;
96
97
  prefixes?: Section<'prefixes'>;
97
98
  conditional_formatting?: Section<'conditionalFormatting'> & {
98
99
  subSectionDefinition?: {
99
100
  bar: SubSection<'stacked'>;
101
+ line: SubSection<'stacked'>;
100
102
  };
101
103
  };
102
104
  }
103
- export declare type ComponentNamespace = 'pivot_table' | 'horizontal_bar_chart' | 'bar_chart' | 'area_chart' | 'line_chart' | 'scatter_chart' | 'pie_chart' | 'single_stat' | 'basic_table' | 'combo_chart' | 'mercator_map' | 'custom' | 'fields' | 'progress';
105
+ export declare type ComponentNamespace = 'pivot_table' | 'horizontal_bar_chart' | 'bar_chart' | 'area_chart' | 'line_chart' | 'scatter_chart' | 'pie_chart' | 'single_stat' | 'basic_table' | 'combo_chart' | 'mercator_map' | 'custom' | 'fields' | 'progress' | 'headline';
104
106
  export {};
@@ -4,6 +4,7 @@ export declare type VizzlyDashboard = {
4
4
  id: Dashboard['id'];
5
5
  parentDashboardId: Dashboard['parentDashboardId'] | undefined;
6
6
  display: Dashboard['display'];
7
+ globalFilters: Dashboard['globalFilters'];
7
8
  componentLibrary: Dashboard['componentLibrary'];
8
9
  createdAt: Dashboard['createdAt'];
9
10
  updatedAt: Dashboard['updatedAt'];
@@ -1,7 +1,7 @@
1
1
  import { DataSet } from './types';
2
2
  import { CustomField, SimpleMathField } from '../CustomField/types';
3
3
  import { DateTimeField, NonDateTimeField } from '../Field/types';
4
- import { Query } from '../Query/types';
4
+ import { PreAggregatedQuery, Query } from '../Query/types';
5
5
  import * as Field from '../Field/Field';
6
6
  import FieldNotFoundInDataSet from '../errors/FieldNotFoundInDataSet';
7
7
  import { QueryAttributes } from '../QueryAttributes/types';
@@ -42,6 +42,6 @@ export declare const findRemovedFieldsBetweenDataSets: (previousDataSets: DataSe
42
42
  export declare const findRemovedFields: (original: DataSet, latest: DataSet) => Array<DataSet.Field>;
43
43
  export declare const buildQueryAttributes: (dataSet: DataSet, queryEngineConfig: QueryEngineConfig, componentType: ComponentType) => QueryAttributes;
44
44
  export declare const buildDownloadQuery: (dataSet: DataSet, maxCSVDownloadLimit: number, viewFilters: QueryAttributes['filter']) => QueryAttributes;
45
- export declare const buildViewOnlyQuery: (dataSet: DataSet) => QueryAttributes;
45
+ export declare const buildViewOnlyQuery: (dataSet: DataSet) => PreAggregatedQuery;
46
46
  export declare const addCustomFields: (dataSets: Array<DataSet>, customFields: RawDashboard['definition']['customFields']) => Array<DataSet>;
47
47
  export declare const validId: (id: string, dataSet: DataSet[]) => boolean;
@@ -9,7 +9,7 @@ export declare type DataSet = {
9
9
  name: string;
10
10
  description?: string;
11
11
  fields: DataSet.Field[];
12
- preAggregated?: boolean;
12
+ preAggregated?: undefined | false | string[];
13
13
  };
14
14
  export declare type FieldFilterOptions = {
15
15
  removeSimplePercentage?: boolean;
@@ -26,4 +26,5 @@ export declare type FeatureToggles = {
26
26
  * @default true */
27
27
  showDateFilter: boolean;
28
28
  canSeeEmptyState: boolean;
29
+ canDownloadPDF: boolean;
29
30
  };
@@ -26,11 +26,12 @@ export declare type AxisLabelsSection = Section<'axisLabels'> & {
26
26
  export declare type LabelsSection = Section<'statsLabels'> & LabelSection<'statsLabels'>;
27
27
  export declare type PrefixSection = Section<'prefixes'>;
28
28
  export declare type MapColorsSection = Section<'mapColors'>;
29
+ export declare type HeadlineSection = Section<'headline'>;
29
30
  export interface ConditionalFormattingSection extends Section<'conditionalFormatting'> {
30
31
  ruleType: FormattingRuleType;
31
32
  subSection?: {
32
33
  title: string;
33
- propKey: 'bar';
34
+ propKey: 'bar' | 'line';
34
35
  }[];
35
36
  }
36
37
  export interface GoalLineSection extends Section<'goalLine'> {
@@ -39,5 +40,5 @@ export interface ProgressTypeSection<T> extends Omit<Section<T>, 'type'> {
39
40
  progressType?: Omit<Section<T>, 'type'>;
40
41
  }
41
42
  export declare type ProgressTypesSection = Section<'progressType'> & ProgressTypeSection<'progressType'>;
42
- export declare type FormatPanelSection = HeadingSection | FormatSection | ChartStylesSection | PrefixSection | AxisLabelsSection | LabelsSection | MapColorsSection | ConditionalFormattingSection | GoalLineSection | ProgressTypesSection;
43
+ export declare type FormatPanelSection = HeadingSection | FormatSection | ChartStylesSection | PrefixSection | AxisLabelsSection | LabelsSection | MapColorsSection | ConditionalFormattingSection | GoalLineSection | ProgressTypesSection | HeadlineSection;
43
44
  export declare type FormatPanelConfig = Array<FormatPanelSection>;
@@ -0,0 +1,5 @@
1
+ import { DataSet as DataSetType } from '../DataSet/types';
2
+ import { QueryAttributes } from '../QueryAttributes/types';
3
+ import { SupportedAggregates } from '../Aggregate';
4
+ import { Component } from '../Component/types';
5
+ export declare function measureIsSuitableFunc(dataSet: DataSetType, item: QueryAttributes.Measure, supportedAggregates: SupportedAggregates, includes?: Component.HeadlineFunction): boolean;
@@ -18,6 +18,7 @@ export declare type DataAccessConfig = {
18
18
  secureFilters: {
19
19
  [dataSetId: string]: QueryAttributes.Filter[];
20
20
  };
21
+ parameters?: Object;
21
22
  expires: string;
22
23
  signature: string;
23
24
  };
@@ -0,0 +1,3 @@
1
+ import { ConversionOptions } from './types';
2
+ export declare const MM_TO_PX = 3.77952755906;
3
+ export declare const DEFAULT_OPTIONS: Readonly<ConversionOptions>;
@@ -0,0 +1,36 @@
1
+ import jsPDF from 'jspdf';
2
+ import { ConversionOptions, Options } from './types';
3
+ export default class Converter {
4
+ pdf: InstanceType<typeof jsPDF>;
5
+ canvas: HTMLCanvasElement;
6
+ options: Options;
7
+ constructor(canvas: HTMLCanvasElement, options: ConversionOptions);
8
+ getMarginTopMM(): number;
9
+ getMarginLeftMM(): number;
10
+ getMarginRightMM(): number;
11
+ getMarginBottomMM(): number;
12
+ getMarginTop(): number;
13
+ getMarginBottom(): number;
14
+ getMarginLeft(): number;
15
+ getMarginRight(): number;
16
+ getScale(): number;
17
+ getPageHeight(): number;
18
+ getPageHeightMM(): number;
19
+ getPageWidthMM(): number;
20
+ getPageWidth(): number;
21
+ getOriginalCanvasWidth(): number;
22
+ getOriginalCanvasHeight(): number;
23
+ getCanvasPageAvailableHeight(): number;
24
+ getPageAvailableWidth(): number;
25
+ getPageAvailableHeight(): number;
26
+ getPageAvailableWidthMM(): number;
27
+ getPageAvailableHeightMM(): number;
28
+ getNumberPages(): number;
29
+ getHorizontalFitFactor(): number;
30
+ getCanvasOffsetY(pageNumber: number): number;
31
+ getCanvasHeightLeft(pageNumber: number): number;
32
+ getCanvasPageHeight(pageNumber: number): number;
33
+ getCanvasPageWidth(): number;
34
+ createCanvasPage(pageNumber: number): HTMLCanvasElement;
35
+ convert(): InstanceType<typeof jsPDF>;
36
+ }
@@ -0,0 +1,17 @@
1
+ import { Options, TargetElementFinder } from './types';
2
+ import jsPDF from 'jspdf';
3
+ export type { Options };
4
+ export declare const generatePDF: (targetRefOrFunction: TargetElementFinder, customOptions?: (Pick<Partial<import("./types").ConversionOptions>, "filename" | "method" | "resolution"> & {
5
+ page?: Partial<import("./types").PageConversionOptions> | undefined;
6
+ canvas?: Partial<Pick<import("html2canvas").Options, "useCORS" | "logging"> & {
7
+ mimeType: "image/jpeg" | "image/png";
8
+ qualityRatio: number;
9
+ }> | undefined;
10
+ overrides?: Partial<{
11
+ pdf?: Partial<import("jspdf").jsPDFOptions> | undefined;
12
+ canvas?: Partial<import("html2canvas").Options> | undefined;
13
+ }> | undefined;
14
+ } & {
15
+ header?: TargetElementFinder | undefined;
16
+ }) | undefined) => Promise<InstanceType<typeof jsPDF>>;
17
+ export default generatePDF;
@@ -0,0 +1,91 @@
1
+ import { jsPDFOptions } from 'jspdf';
2
+ import { Options as Html2CanvasOptions } from 'html2canvas';
3
+ export declare type PDFSettings = {
4
+ header?: string;
5
+ };
6
+ export declare type DetailedMargin = {
7
+ top: Margin | number;
8
+ right: Margin | number;
9
+ bottom: Margin | number;
10
+ left: Margin | number;
11
+ };
12
+ export declare type Orientation = jsPDFOptions['orientation'];
13
+ export declare type PageConversionOptions = {
14
+ /** Margin of the page in MM, defaults to 0. */
15
+ margin: DetailedMargin | Margin | number;
16
+ /** Format of the page (A4, letter), defaults to A4. */
17
+ format: jsPDFOptions['format'];
18
+ /** Orientation of the page (portrait or landscape), defaults to `portrait`. */
19
+ orientation: Orientation;
20
+ };
21
+ declare type CanvasConversionOptions = Pick<Html2CanvasOptions, 'useCORS' | 'logging'> & {
22
+ /**
23
+ * Mime type of the canvas captured from the screenshot, defaults to
24
+ * 'image/jpeg' for better size performance.
25
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL
26
+ */
27
+ mimeType: 'image/jpeg' | 'image/png';
28
+ /**
29
+ * Quality ratio of the canvas captured from the screenshot
30
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL
31
+ */
32
+ qualityRatio: number;
33
+ };
34
+ export declare type ConversionOptions = {
35
+ /**
36
+ * File name of the PDF file if the method select is `save`, which is the
37
+ * default. Not used for the `build` and `open` methods. *
38
+ */
39
+ filename?: string;
40
+ /**
41
+ * Method that will follow to do with the PDF file. The `build` method just
42
+ * returns the PDF instance in the invoked function `generatePDF` or `toPDF`.
43
+ * By default is `open`.
44
+ */
45
+ method: 'save' | 'open' | 'build';
46
+ /**
47
+ * Resolution in a scale where 1 gives a low resolution and possible blurred
48
+ * image, 3 a medium and 10 an extreme quality. The size of the file increases
49
+ * as the resolution is higher. Not recommended to use extreme resolution, e.g
50
+ * '>= 10' for multiple pages otherwise this can make the browser cache hang
51
+ * or crash, due to the size of the image generated for the PDF.
52
+ */
53
+ resolution: Resolution | number;
54
+ /** Page options */
55
+ page: PageConversionOptions;
56
+ /** Canvas options */
57
+ canvas: CanvasConversionOptions;
58
+ /** Override values passed for the jsPDF document and html2canvas */
59
+ overrides: {
60
+ /**
61
+ * Override the values passed for the jsPDF instance. See its docs for more details
62
+ * in https://artskydj.github.io/jsPDF/docs/jsPDF.html.
63
+ * */
64
+ pdf?: Partial<jsPDFOptions>;
65
+ /**
66
+ * Override the values passed for the html2canvas function. See its docs
67
+ * for more details in https://html2canvas.hertzen.com/documentation
68
+ * */
69
+ canvas?: Partial<Html2CanvasOptions>;
70
+ };
71
+ };
72
+ export declare type Options = Omit<Partial<ConversionOptions>, 'page' | 'canvas' | 'overrides'> & {
73
+ page?: Partial<PageConversionOptions>;
74
+ canvas?: Partial<CanvasConversionOptions>;
75
+ overrides?: Partial<ConversionOptions['overrides']>;
76
+ };
77
+ export declare type TargetElementFinder = () => HTMLElement | null;
78
+ export declare enum Resolution {
79
+ LOW = 1,
80
+ NORMAL = 2,
81
+ MEDIUM = 3,
82
+ HIGH = 7,
83
+ EXTREME = 12
84
+ }
85
+ export declare enum Margin {
86
+ NONE = 0,
87
+ SMALL = 5,
88
+ MEDIUM = 10,
89
+ LARGE = 25
90
+ }
91
+ export {};
@@ -0,0 +1,2 @@
1
+ import { ConversionOptions, Options } from './types';
2
+ export declare const buildConvertOptions: (options?: Options | undefined) => ConversionOptions;
@@ -1,4 +1,4 @@
1
- import { PreparedQuery, Query, SubQuery } from './types';
1
+ import { PreAggregatedQuery, PreparedQuery, Query, SubQuery } from './types';
2
2
  import { QueryAttributes } from '../QueryAttributes/types';
3
3
  import { QueryEngineConfig, SupportedFeature as SupportedFeatureType } from '../QueryEngineConfig/types';
4
4
  import { DataSet } from '../DataSet/types';
@@ -19,7 +19,11 @@ export declare const hasDimensions: (query: {
19
19
  group: Query['group'];
20
20
  }) => boolean;
21
21
  export declare const getMeasures: (query: Query) => Query['measure'];
22
- export declare const buildPreparedQuery: (dataSetId: string, dataSetField: DataSet['fields'][number], optionsFilters?: import("./types").QueryNameSpace.Filter<import("./types").QueryNameSpace.FieldDefinition<string, string, string>, string>[][] | undefined) => {
22
+ export declare const buildPreAggregatedPreparedQuery: (query: PreAggregatedQuery, dataSet: DataSet) => {
23
+ query: PreAggregatedQuery;
24
+ resultFields: Result.Field[];
25
+ };
26
+ export declare const buildUniqueArrayValuesPreparedQuery: (dataSetId: string, dataSetField: DataSet['fields'][number], optionsFilters?: import("./types").QueryNameSpace.Filter<import("./types").QueryNameSpace.FieldDefinition<string, string, string>, string>[][] | undefined) => {
23
27
  query: PreparedQuery;
24
28
  resultFields: Result.Field[];
25
29
  };
@@ -99,7 +99,13 @@ export declare type UniqueArrayValuesQuery = BasePreparedQuery<'uniqueArrayValue
99
99
  fieldId: string;
100
100
  filter: Query['filter'];
101
101
  };
102
- export declare type PreparedQuery = UniqueArrayValuesQuery;
102
+ export declare type PreAggregatedQuery = BasePreparedQuery<'preAggregated'> & {
103
+ dataSetId: string;
104
+ filter: {
105
+ [dataSetId: string]: Query['filter'];
106
+ };
107
+ };
108
+ export declare type PreparedQuery = UniqueArrayValuesQuery | PreAggregatedQuery;
103
109
  /** Most commonly used query format. */
104
110
  export declare type Query<SupportedFunction = string, ComparisonOperator = string, MathsOp = string> = {
105
111
  type: 'query';
@@ -2,7 +2,7 @@ import { SupportedAggregates } from '../Aggregate';
2
2
  import { SupportedTimeTruncFunctions } from '../TimeDimension/types';
3
3
  import { SupportedOperators } from '../QueryAttributes/types';
4
4
  import { SupportedTransformationFunctions } from '../Functions/types';
5
- export declare type SupportedFeature = 'subquery' | 'simpleMaths' | 'aggregateMaths' | 'switchField' | 'configManagerUi' | 'roundedNumbers' | 'sqlDefinedDataSet' | 'encryptedDashboards';
5
+ export declare type SupportedFeature = 'subquery' | 'simpleMaths' | 'aggregateMaths' | 'switchField' | 'configManagerUi' | 'roundedNumbers' | 'sqlDefinedDataSet' | 'encryptedDashboards' | 'sqlViews';
6
6
  export declare type QueryEngineConfig = {
7
7
  origin?: 'in-browser' | 'query-engine' | 'custom';
8
8
  supportedFeatures: SupportedFeature[];
@@ -0,0 +1,11 @@
1
+ export declare const findUsedDataSets: (sql: string | undefined, dataSets: Array<{
2
+ name: string;
3
+ id: string;
4
+ }>) => {
5
+ id: string;
6
+ name: string;
7
+ }[];
8
+ export declare const usedDataSetDescription: (usedDataSets: Array<{
9
+ id: string;
10
+ name: string;
11
+ }>) => string;
@@ -0,0 +1,7 @@
1
+ export declare type SqlViewStore = {
2
+ [sqlViewId: string]: SqlView;
3
+ };
4
+ export declare type SqlView = {
5
+ sql: string;
6
+ name: string;
7
+ };
@@ -0,0 +1 @@
1
+ export declare const simpleInsecureHash: (str: string, prefix: 'data_set' | 'field') => string;
@@ -297,6 +297,8 @@ export declare namespace VizzlyTheming {
297
297
  axisTitles?: ChartAxisTitle;
298
298
  grid?: ChartGrid;
299
299
  axis?: ChartAxis;
300
+ pie?: Pie;
301
+ barChart?: BarChart;
300
302
  };
301
303
  interface ViewText extends FontStyle {
302
304
  textAlign?: CSSProperties['textAlign'];
@@ -479,10 +481,23 @@ export declare namespace VizzlyTheming {
479
481
  };
480
482
  };
481
483
  type Icons = {
484
+ borderRadius?: CSSProperties['borderRadius'];
482
485
  color?: CSSProperties['color'];
486
+ padding?: CSSProperties['padding'];
487
+ width?: CSSProperties['width'];
488
+ height?: CSSProperties['height'];
483
489
  '&:hover'?: {
484
490
  color?: CSSProperties['color'];
491
+ background?: CSSProperties['background'];
485
492
  };
486
493
  };
494
+ type Pie = {
495
+ cornerRadius?: number;
496
+ gap?: boolean;
497
+ hole?: boolean;
498
+ };
499
+ type BarChart = {
500
+ cornerRadius?: number;
501
+ };
487
502
  }
488
503
  export declare type ThemeVersion = 1 | 2;
@@ -0,0 +1,10 @@
1
+ import { Component } from '../Component/types';
2
+ declare type ThresholdDirecton = '>=' | '<=';
3
+ declare type ThresholdType = {
4
+ key: string;
5
+ value: number;
6
+ color: string;
7
+ direction: ThresholdDirecton;
8
+ };
9
+ export declare const buildThreshold: (formatting?: Component.ConditionalFormatting.Rule[] | undefined) => ThresholdType[];
10
+ export {};