@sisense/sdk-ui 1.0.0 → 1.1.0

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 (48) hide show
  1. package/dist/ai.js +2 -2
  2. package/dist/api/rest-api.d.ts +9 -0
  3. package/dist/app/settings/settings.d.ts +1 -0
  4. package/dist/areamap-chart.d.ts +28 -0
  5. package/dist/chart-data/areamap-data.d.ts +4 -0
  6. package/dist/chart-data/data-coloring/geo-data-coloring-function.d.ts +2 -0
  7. package/dist/chart-data/types.d.ts +29 -3
  8. package/dist/chart-data-options/translate-scattermap-data-options.d.ts +1 -1
  9. package/dist/chart-data-options/types.d.ts +23 -5
  10. package/dist/chart-options-processor/boxplot-chart-options.d.ts +2 -1
  11. package/dist/chart-options-processor/chart-options-service.d.ts +3 -1
  12. package/dist/chart-options-processor/style-to-design-options-translator/translate-to-areamap-options.d.ts +3 -0
  13. package/dist/chart-options-processor/subtype-to-design-options.d.ts +4 -1
  14. package/dist/chart-options-processor/translations/boxplot/boxplot-tooltip.d.ts +2 -1
  15. package/dist/chart-options-processor/translations/design-options.d.ts +7 -1
  16. package/dist/chart-options-processor/translations/types.d.ts +7 -3
  17. package/dist/charts/map-charts/areamap/alternative-country-names-dictionary.d.ts +9 -0
  18. package/dist/charts/map-charts/areamap/areamap-map.d.ts +16 -0
  19. package/dist/charts/map-charts/areamap/areamap.d.ts +16 -0
  20. package/dist/charts/map-charts/areamap/feature-styles-dictionary.d.ts +16 -0
  21. package/dist/charts/map-charts/areamap/use-geo-json.d.ts +9 -0
  22. package/dist/charts/map-charts/scattermap/hooks/use-locations.d.ts +3 -0
  23. package/dist/charts/{scattermap → map-charts/scattermap}/hooks/use-tooltip-handler.d.ts +2 -2
  24. package/dist/charts/{scattermap → map-charts/scattermap}/scattermap.d.ts +3 -3
  25. package/dist/charts/map-charts/scattermap/utils/color.d.ts +3 -0
  26. package/dist/charts/{scattermap → map-charts/scattermap}/utils/size.d.ts +1 -1
  27. package/dist/charts/{scattermap → map-charts/scattermap}/utils/tooltip.d.ts +2 -2
  28. package/dist/dashboard-widget/types.d.ts +5 -3
  29. package/dist/index.d.ts +1 -0
  30. package/dist/index.js +3362 -3403
  31. package/dist/props.d.ts +19 -2
  32. package/dist/table-widget-4275c061.js +77714 -0
  33. package/dist/translation/resources/en.d.ts +10 -0
  34. package/dist/translation/resources/index.d.ts +20 -0
  35. package/dist/types.d.ts +17 -5
  36. package/dist/utils/filters-comparator.d.ts +13 -1
  37. package/dist/widgets/common/drilldown-breadcrumbs/styled-buttons.d.ts +2 -2
  38. package/package.json +9 -6
  39. package/dist/charts/scattermap/hooks/use-locations.d.ts +0 -3
  40. package/dist/charts/scattermap/utils/color.d.ts +0 -3
  41. package/dist/table-widget-7936746a.js +0 -72481
  42. /package/dist/charts/{scattermap → map-charts/scattermap}/hooks/use-settings.d.ts +0 -0
  43. /package/dist/charts/{scattermap → map-charts/scattermap}/types.d.ts +0 -0
  44. /package/dist/charts/{scattermap → map-charts/scattermap}/utils/copyright.d.ts +0 -0
  45. /package/dist/charts/{scattermap → map-charts/scattermap}/utils/location.d.ts +0 -0
  46. /package/dist/charts/{scattermap → map-charts/scattermap}/utils/map.d.ts +0 -0
  47. /package/dist/charts/{scattermap → map-charts/scattermap}/utils/markers.d.ts +0 -0
  48. /package/dist/charts/{scattermap → map-charts/scattermap}/utils/values.d.ts +0 -0
@@ -0,0 +1,3 @@
1
+ import { AreamapStyleOptions } from '../../types.js';
2
+ import { AreamapChartDesignOptions } from '../translations/design-options.js';
3
+ export declare const getAreamapChartDesignOptions: (styleOptions: AreamapStyleOptions) => AreamapChartDesignOptions;
@@ -1,5 +1,6 @@
1
1
  import { LineType, StackType } from './translations/translations-to-highcharts';
2
2
  import { IndicatorStyleType, PolarType, BoxplotType } from './translations/design-options';
3
+ import { AreamapType } from '../types';
3
4
  /**
4
5
  * Property of {@link LineStyleOptions}
5
6
  *
@@ -90,7 +91,8 @@ export type TreemapSubtype = 'treemap';
90
91
  export type SunburstSubtype = 'sunburst';
91
92
  export type BoxplotSubtype = 'boxplot/full' | 'boxplot/hollow';
92
93
  export type ScattermapSubtype = 'scattermap';
93
- export type ChartSubtype = LineSubtype | AreaSubtype | StackableSubtype | PieSubtype | PolarSubtype | IndicatorSubtype | TreemapSubtype | SunburstSubtype | BoxplotSubtype | ScattermapSubtype;
94
+ export type AreamapSubtype = 'areamap/world' | 'areamap/usa';
95
+ export type ChartSubtype = LineSubtype | AreaSubtype | StackableSubtype | PieSubtype | PolarSubtype | IndicatorSubtype | TreemapSubtype | SunburstSubtype | BoxplotSubtype | ScattermapSubtype | AreamapSubtype;
94
96
  export declare const chartSubtypeToDesignOptions: Readonly<Record<ChartSubtype, {
95
97
  lineType?: LineType | undefined;
96
98
  stackType?: StackType | undefined;
@@ -98,4 +100,5 @@ export declare const chartSubtypeToDesignOptions: Readonly<Record<ChartSubtype,
98
100
  polarType?: PolarType | undefined;
99
101
  indicatorType?: IndicatorStyleType | undefined;
100
102
  boxplotType?: BoxplotType | undefined;
103
+ mapType?: AreamapType | undefined;
101
104
  }>>;
@@ -1,3 +1,4 @@
1
+ import { TFunction } from '@sisense/sdk-common';
1
2
  import { BoxplotChartDataOptionsInternal } from '../../../chart-data-options/types';
2
3
  import { TooltipSettings } from '../tooltip-utils';
3
- export declare const getBoxplotTooltipSettings: (dataOptions: BoxplotChartDataOptionsInternal) => TooltipSettings;
4
+ export declare const getBoxplotTooltipSettings: (dataOptions: BoxplotChartDataOptionsInternal, translate: TFunction) => TooltipSettings;
@@ -5,7 +5,7 @@ import { LegendPosition } from './legend-section';
5
5
  import { LineType, StackType } from './translations-to-highcharts';
6
6
  import { PieType, PieLabels } from './pie-plot-options';
7
7
  import { FunnelSize, FunnelType, FunnelDirection, FunnelLabels } from './funnel-plot-options';
8
- import { Convolution, ScattermapMarkers, SunburstStyleOptions, TreemapStyleOptions } from '../../types';
8
+ import { AreamapType, Convolution, ScattermapMarkers, SunburstStyleOptions, TreemapStyleOptions } from '../../types';
9
9
  import { ScatterMarkerSize } from './scatter-plot-options';
10
10
  type DataLimits = {
11
11
  seriesCapacity: number;
@@ -48,6 +48,12 @@ export type SunburstChartDesignOptions = BaseDesignOptionsType & SunburstStyleOp
48
48
  export type ScatterChartDesignOptions = BaseDesignOptionsType & {
49
49
  markerSize?: ScatterMarkerSize;
50
50
  };
51
+ /**
52
+ * Configuration for Areamap design options
53
+ */
54
+ export type AreamapChartDesignOptions = BaseDesignOptionsType & {
55
+ mapType: AreamapType;
56
+ };
51
57
  /**
52
58
  * Configuration for Table design options
53
59
  *
@@ -1,6 +1,6 @@
1
1
  import { ChartDataOptionsInternal } from '../../chart-data-options/types';
2
2
  import { ChartType } from '../../types';
3
- import { LineChartDesignOptions, AreaChartDesignOptions, BarChartDesignOptions, ColumnChartDesignOptions, PieChartDesignOptions, FunnelChartDesignOptions, IndicatorChartDesignOptions, PolarChartDesignOptions, ScatterChartDesignOptions, TreemapChartDesignOptions, BoxplotChartDesignOptions, ScattermapChartDesignOptions } from './design-options';
3
+ import { LineChartDesignOptions, AreaChartDesignOptions, BarChartDesignOptions, ColumnChartDesignOptions, PieChartDesignOptions, FunnelChartDesignOptions, IndicatorChartDesignOptions, PolarChartDesignOptions, ScatterChartDesignOptions, TreemapChartDesignOptions, BoxplotChartDesignOptions, AreamapChartDesignOptions, ScattermapChartDesignOptions } from './design-options';
4
4
  export declare const POLAR_CHART_TYPES: readonly ["polar"];
5
5
  export type PolarChartType = (typeof POLAR_CHART_TYPES)[number];
6
6
  export declare const CARTESIAN_CHART_TYPES: readonly ["line", "area", "bar", "column", "polar"];
@@ -21,13 +21,16 @@ export type IndicatorChartType = (typeof INDICATOR_CHART_TYPES)[number];
21
21
  declare const BOXPLOT_CHART_TYPES: readonly ["boxplot"];
22
22
  /** Boxplot chart types @expandType */
23
23
  export type BoxplotChartType = (typeof BOXPLOT_CHART_TYPES)[number];
24
+ declare const AREAMAP_CHART_TYPES: readonly ["areamap"];
25
+ /** Areamap chart types @expandType */
26
+ export type AreamapChartType = (typeof AREAMAP_CHART_TYPES)[number];
24
27
  declare const IMAGE_CHART_TYPES: readonly ["image"];
25
28
  export type ImageChartType = (typeof IMAGE_CHART_TYPES)[number];
26
29
  export declare const SCATTERMAP_CHART_TYPES: readonly ["scattermap"];
27
30
  /** Scattermap chart types @expandType */
28
31
  export type ScattermapChartType = (typeof SCATTERMAP_CHART_TYPES)[number];
29
- export type ChartDataType = 'cartesian' | 'categorical' | 'scatter' | 'table' | 'indicator';
30
- export type ChartDesignOptions = LineChartDesignOptions | AreaChartDesignOptions | BarChartDesignOptions | ColumnChartDesignOptions | PieChartDesignOptions | FunnelChartDesignOptions | PolarChartDesignOptions | IndicatorChartDesignOptions | ScatterChartDesignOptions | TreemapChartDesignOptions | BoxplotChartDesignOptions | ScattermapChartDesignOptions;
32
+ export type ChartDataType = 'cartesian' | 'categorical' | 'scatter' | 'table' | 'indicator' | 'areamap';
33
+ export type ChartDesignOptions = LineChartDesignOptions | AreaChartDesignOptions | BarChartDesignOptions | ColumnChartDesignOptions | PieChartDesignOptions | FunnelChartDesignOptions | PolarChartDesignOptions | IndicatorChartDesignOptions | ScatterChartDesignOptions | TreemapChartDesignOptions | BoxplotChartDesignOptions | AreamapChartDesignOptions | ScattermapChartDesignOptions;
31
34
  export type ChartConfig = {
32
35
  chartType: ChartType;
33
36
  dataOptions: ChartDataOptionsInternal;
@@ -41,4 +44,5 @@ export declare const isIndicator: (chartType: ChartType) => chartType is "indica
41
44
  export declare const isPolar: (chartType: ChartType) => chartType is "polar";
42
45
  export declare const isTable: (chartType: ChartType | TableType) => chartType is "table";
43
46
  export declare const isBoxplot: (chartType: ChartType) => chartType is "boxplot";
47
+ export declare const isAreamap: (chartType: ChartType) => chartType is "areamap";
44
48
  export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * List of alternative country names (synonyms) that can be used to match country names from data.
3
+ * For example, 'United States', 'USA' and 'United States of America' should be understood as the same country.
4
+ */
5
+ export declare const ALTERNATIVE_COUNTRY_NAMES_DICTIONARY: {
6
+ officialName: string;
7
+ allNames: string[];
8
+ id: string;
9
+ }[];
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { FeatureCollection as GeoJsonFeatureCollection } from 'geojson';
3
+ import { GeoDataElement } from '../../../chart-data/types.js';
4
+ import { AreamapType } from '../../../types.js';
5
+ export type AreamapProps = {
6
+ geoJson: GeoJsonFeatureCollection;
7
+ geoData: GeoDataElement[];
8
+ dataOptions: {
9
+ originalValueTitle: string;
10
+ };
11
+ mapType: AreamapType;
12
+ };
13
+ /**
14
+ * Component that renders a map with areas (countries or states) for using in Areamap chart
15
+ */
16
+ export declare const AreamapMap: React.FC<AreamapProps>;
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { AreamapChartDataOptionsInternal, ChartDataOptionsInternal } from '../../../chart-data-options/types.js';
3
+ import { AreamapData, ChartData } from '../../../chart-data/types.js';
4
+ import { AreamapChartDesignOptions } from '../../../chart-options-processor/translations/design-options.js';
5
+ import { ChartDesignOptions } from '../../../chart-options-processor/translations/types.js';
6
+ import { ThemeSettings } from '../../../types.js';
7
+ export type AreamapChartProps = {
8
+ chartData: AreamapData;
9
+ dataOptions: AreamapChartDataOptionsInternal;
10
+ designOptions: AreamapChartDesignOptions;
11
+ themeSettings: ThemeSettings;
12
+ };
13
+ export declare const Areamap: React.FC<AreamapChartProps>;
14
+ export declare const isAreamapData: (chartData: ChartData) => chartData is AreamapData;
15
+ export declare const isAreamapDataOptions: (dataOptions: ChartDataOptionsInternal) => dataOptions is AreamapChartDataOptionsInternal;
16
+ export declare const isAreamapChartDesignOptions: (designOptions: ChartDesignOptions) => designOptions is AreamapChartDesignOptions;
@@ -0,0 +1,16 @@
1
+ import { Feature as GeoJsonFeature } from 'geojson';
2
+ import { PathOptions } from 'leaflet';
3
+ import { GeoDataElement } from '../../../chart-data/types.js';
4
+ import { AreamapType } from '../../../types.js';
5
+ export type FeatureId = GeoJsonFeature['id'] & string;
6
+ export type FeatureInfo = {
7
+ /** Corresponding GeoDataElement from GeoData */
8
+ geoDataElement?: GeoDataElement;
9
+ style: PathOptions;
10
+ displayName: string;
11
+ };
12
+ export type FeaturesDictionary = Record<FeatureId, FeatureInfo>;
13
+ /**
14
+ * Creates a dictionary of feature styles for each feature in geoJson
15
+ */
16
+ export declare function createFeatureStylesDictionary(geoFeatures: GeoJsonFeature[], geoData: GeoDataElement[], mapType: AreamapType): FeaturesDictionary;
@@ -0,0 +1,9 @@
1
+ import { FeatureCollection as GeoJsonFeatureCollection } from 'geojson';
2
+ import { AreamapType } from '../../../types.js';
3
+ /**
4
+ * Hook to get geoJson from API or cache (LocalStorage)
5
+ */
6
+ export declare const useGeoJson: (mapType: AreamapType) => {
7
+ geoJson: GeoJsonFeatureCollection | undefined;
8
+ error: Error | undefined;
9
+ };
@@ -0,0 +1,3 @@
1
+ import { ScattermapLocationLevel } from '../../../../chart-data-options/types.js';
2
+ import { ScattermapChartLocation } from '../../../../chart-data/types';
3
+ export declare const useLocations: (locations: ScattermapChartLocation[], locationLevel: ScattermapLocationLevel) => ScattermapChartLocation[];
@@ -1,5 +1,5 @@
1
- import { ScattermapChartLocation } from '../../../chart-data/types';
2
- import { ScattermapChartDataOptionsInternal } from '../../../chart-data-options/types.js';
1
+ import { ScattermapChartLocation } from '../../../../chart-data/types';
2
+ import { ScattermapChartDataOptionsInternal } from '../../../../chart-data-options/types.js';
3
3
  import { DataSource, Filter } from '@sisense/sdk-data';
4
4
  export type TooltipOptions = {
5
5
  content: string;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { ScattermapChartData } from '../../chart-data/types.js';
3
- import { ScattermapChartDataOptionsInternal } from '../../chart-data-options/types.js';
4
- import { ScattermapChartDesignOptions } from '../../chart-options-processor/translations/design-options.js';
2
+ import { ScattermapChartData } from '../../../chart-data/types.js';
3
+ import { ScattermapChartDataOptionsInternal } from '../../../chart-data-options/types.js';
4
+ import { ScattermapChartDesignOptions } from '../../../chart-options-processor/translations/design-options.js';
5
5
  import { DataSource, Filter, FilterRelation } from '@sisense/sdk-data';
6
6
  export type ScattermapProps = {
7
7
  chartData: ScattermapChartData;
@@ -0,0 +1,3 @@
1
+ import { ScattermapChartLocation } from '../../../../chart-data/types.js';
2
+ import { DataColorOptions } from '../../../../types.js';
3
+ export declare function getLocationsMarkerColors(locations: ScattermapChartLocation[], colorOptions?: DataColorOptions): string[];
@@ -1,2 +1,2 @@
1
- import { ScattermapChartLocation } from '../../../chart-data/types.js';
1
+ import { ScattermapChartLocation } from '../../../../chart-data/types.js';
2
2
  export declare function getLocationsMarkerSizes(locations: ScattermapChartLocation[], minsize?: number, maxsize?: number): number[];
@@ -1,5 +1,5 @@
1
- import { ScattermapChartLocation } from '../../../chart-data/types';
2
- import { ScattermapChartDataOptionsInternal } from '../../../chart-data-options/types.js';
1
+ import { ScattermapChartLocation } from '../../../../chart-data/types';
2
+ import { ScattermapChartDataOptionsInternal } from '../../../../chart-data-options/types.js';
3
3
  export declare const enum TooltipShowDetails {
4
4
  YES = 0,
5
5
  NO = 1,
@@ -14,8 +14,8 @@ export type TabularWidgetType = 'tablewidget' | 'tablewidgetagg';
14
14
  /**
15
15
  * The type of a widget on a dashboard.
16
16
  */
17
- export type WidgetType = CartesianWidgetType | CategoricalWidgetType | 'chart/scatter' | 'indicator' | TabularWidgetType | 'chart/boxplot' | 'map/scatter';
18
- export type WidgetSubtype = 'area/basic' | 'area/stacked' | 'area/stacked100' | 'area/spline' | 'area/stackedspline' | 'area/stackedspline100' | 'bar/classic' | 'bar/stacked' | 'bar/stacked100' | 'column/classic' | 'column/stackedcolumn' | 'column/stackedcolumn100' | 'line/basic' | 'line/spline' | 'pie/classic' | 'pie/donut' | 'pie/ring' | 'column/polar' | 'area/polar' | 'line/polar' | 'indicator/numeric' | 'indicator/gauge' | 'bubble/scatter' | 'treemap' | 'sunburst' | 'boxplot/full' | 'boxplot/hollow' | 'map/scatter';
17
+ export type WidgetType = CartesianWidgetType | CategoricalWidgetType | 'chart/scatter' | 'indicator' | TabularWidgetType | 'chart/boxplot' | 'map/scatter' | 'map/area';
18
+ export type WidgetSubtype = 'area/basic' | 'area/stacked' | 'area/stacked100' | 'area/spline' | 'area/stackedspline' | 'area/stackedspline100' | 'bar/classic' | 'bar/stacked' | 'bar/stacked100' | 'column/classic' | 'column/stackedcolumn' | 'column/stackedcolumn100' | 'line/basic' | 'line/spline' | 'pie/classic' | 'pie/donut' | 'pie/ring' | 'column/polar' | 'area/polar' | 'line/polar' | 'indicator/numeric' | 'indicator/gauge' | 'bubble/scatter' | 'treemap' | 'sunburst' | 'boxplot/full' | 'boxplot/hollow' | 'map/scatter' | 'areamap/world' | 'areamap/usa';
19
19
  export declare enum WidgetDashboardFilterMode {
20
20
  FILTER = "filter",
21
21
  SELECT = "select"
@@ -322,7 +322,9 @@ export type ScattermapWidgetStyle = {
322
322
  };
323
323
  };
324
324
  };
325
- export type WidgetStyle = CartesianWidgetStyle | PolarWidgetStyle | FunnelWidgetStyle | ScatterWidgetStyle | TableWidgetStyle | IndicatorWidgetStyle | TreemapWidgetStyle | SunburstWidgetStyle | BoxplotWidgetStyle | ScattermapWidgetStyle;
325
+ /** Currently, WidgetStyle for areamap is an empty object */
326
+ export type AreamapWidgetStyle = {};
327
+ export type WidgetStyle = CartesianWidgetStyle | PolarWidgetStyle | FunnelWidgetStyle | ScatterWidgetStyle | TableWidgetStyle | IndicatorWidgetStyle | TreemapWidgetStyle | SunburstWidgetStyle | BoxplotWidgetStyle | ScattermapWidgetStyle | AreamapWidgetStyle;
326
328
  export declare enum FiltersMergeStrategyEnum {
327
329
  WIDGET_FIRST = "widgetFirst",
328
330
  CODE_FIRST = "codeFirst",
package/dist/index.d.ts CHANGED
@@ -29,6 +29,7 @@ export * from './treemap-chart';
29
29
  export * from './sunburst-chart';
30
30
  export * from './boxplot-chart';
31
31
  export * from './scattermap-chart';
32
+ export * from './areamap-chart';
32
33
  export * from './sisense-context/custom-sisense-context-provider';
33
34
  export * from './theme-provider/custom-theme-provider';
34
35
  export { getThemeSettingsByOid } from './themes/theme-loader';