2023-04-07 13:51:35 +00:00
|
|
|
import { FILL_WIDGET_MIN_WIDTH } from "constants/minWidthConstants";
|
|
|
|
|
import { ResponsiveBehavior } from "utils/autoLayout/constants";
|
2022-01-07 09:57:45 +00:00
|
|
|
import { dataSetForWorld, MapTypes } from "./constants";
|
2022-01-21 10:19:10 +00:00
|
|
|
import IconSVG from "./icon.svg";
|
|
|
|
|
import Widget from "./widget";
|
2023-07-22 05:57:18 +00:00
|
|
|
import { WIDGET_TAGS } from "constants/WidgetConstants";
|
2022-01-07 09:57:45 +00:00
|
|
|
|
|
|
|
|
export const CONFIG = {
|
|
|
|
|
type: Widget.getWidgetType(),
|
|
|
|
|
name: "Map Chart", // The display name which will be made in uppercase and show in the widgets panel ( can have spaces )
|
|
|
|
|
iconSVG: IconSVG,
|
2023-07-22 05:57:18 +00:00
|
|
|
tags: [WIDGET_TAGS.DISPLAY],
|
2022-01-07 09:57:45 +00:00
|
|
|
needsMeta: true, // Defines if this widget adds any meta properties
|
|
|
|
|
isCanvas: false, // Defines if this widget has a canvas within in which we can drop other widgets
|
2022-06-17 03:12:47 +00:00
|
|
|
searchTags: ["graph", "visuals", "visualisations"],
|
2022-01-07 09:57:45 +00:00
|
|
|
defaults: {
|
|
|
|
|
rows: 32,
|
|
|
|
|
columns: 24,
|
|
|
|
|
widgetName: "MapChart",
|
|
|
|
|
version: 1,
|
|
|
|
|
mapType: MapTypes.WORLD,
|
|
|
|
|
mapTitle: "Global Population",
|
|
|
|
|
showLabels: true,
|
|
|
|
|
data: dataSetForWorld,
|
|
|
|
|
colorRange: [
|
|
|
|
|
{
|
|
|
|
|
minValue: 0.5,
|
|
|
|
|
maxValue: 1.0,
|
|
|
|
|
code: "#FFD74D",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
minValue: 1.0,
|
|
|
|
|
maxValue: 2.0,
|
|
|
|
|
code: "#FB8C00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
minValue: 2.0,
|
|
|
|
|
maxValue: 3.0,
|
|
|
|
|
code: "#E65100",
|
|
|
|
|
},
|
|
|
|
|
],
|
2023-04-07 13:51:35 +00:00
|
|
|
responsiveBehavior: ResponsiveBehavior.Fill,
|
|
|
|
|
minWidth: FILL_WIDGET_MIN_WIDTH,
|
2022-01-07 09:57:45 +00:00
|
|
|
},
|
|
|
|
|
properties: {
|
|
|
|
|
derived: Widget.getDerivedPropertiesMap(),
|
|
|
|
|
default: Widget.getDefaultPropertiesMap(),
|
|
|
|
|
meta: Widget.getMetaPropertiesMap(),
|
|
|
|
|
config: Widget.getPropertyPaneConfig(),
|
2022-08-09 13:05:36 +00:00
|
|
|
contentConfig: Widget.getPropertyPaneContentConfig(),
|
|
|
|
|
styleConfig: Widget.getPropertyPaneStyleConfig(),
|
2022-11-28 04:44:31 +00:00
|
|
|
stylesheetConfig: Widget.getStylesheetConfig(),
|
2023-07-08 14:07:26 +00:00
|
|
|
setterConfig: Widget.getSetterConfig(),
|
2023-04-14 06:27:49 +00:00
|
|
|
autocompleteDefinitions: Widget.getAutocompleteDefinitions(),
|
2022-01-07 09:57:45 +00:00
|
|
|
},
|
2023-04-07 13:51:35 +00:00
|
|
|
autoLayout: {
|
|
|
|
|
widgetSize: [
|
|
|
|
|
{
|
|
|
|
|
viewportMinWidth: 0,
|
|
|
|
|
configuration: () => {
|
|
|
|
|
return {
|
|
|
|
|
minWidth: "280px",
|
|
|
|
|
minHeight: "300px",
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
2022-01-07 09:57:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default Widget;
|