@hpcc-js/ddl-shim 3.2.0 → 3.2.2
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/dist/index.js +2 -889
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +2 -2
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["VisibilitySet: VisibilityType[]","classMappings: any","propertyMappings: any","dermPanelObj: any","dermPanelProps: any","dermWidgetObj: any","dermWidgetProps: any","retVal: DDLProperties","cellPosition: CellPosition","UPGRADE_HEX_CHAR: boolean","retVal: IDatasourceOutput[]","retVal: { [id: string]: IDatasourceOutputFilter }","ddl2DS: DDL2.IWUResult","ddl2DS: DDL2.IHipieService","projectTransformations: DDL2.ProjectTransformationType[]","groupByColumns: string[]","aggrFields: DDL2.IAggregate[]","props: any","retVal: DDL2.IMapMapping[]","newValue: { [key: string]: string | number | boolean | undefined }","condition: DDL2.IFilterCondition","project: DDL2.IProject","filters: DDL2.IFilter","groupBy: DDL2.IGroupBy","sort: DDL2.ISort","limit: DDL2.ILimit","mappings: DDL2.IMappings","datasourceRef: DDL2.IDatasourceBaseRef | DDL2.IRoxieServiceRef","retVal: DDL2.IFieldString","retVal: DDL2.DatasourceType[]","retVal: DDL2.IView[]","ddl2Schema: object","options: _Ajv.Options","ajv: _Ajv.Ajv"],"sources":["../src/__package__.ts","../src/ddl/v1.ts","../src/ddl/v2.ts","../src/dermatology.ts","../src/upgrade.ts","../schema/v2.json","../src/validate.ts","../src/index.ts"],"sourcesContent":["export const PKG_NAME = \"__PACKAGE_NAME__\";\nexport const PKG_VERSION = \"__PACKAGE_VERSION__\";\nexport const BUILD_VERSION = \"__BUILD_VERSION__\";\n","export type StringStringDict = { [key: string]: string; };\n\n// Datasource ===============================================================\nexport type IFilterRule = \"==\" | \"!=\" | \"<\" | \"<=\" | \">\" | \">=\" | \"set\" | \"notequals\";\nexport interface IFilter {\n fieldid: string;\n nullable: boolean;\n rule: IFilterRule;\n minid?: string;\n maxid?: string;\n}\n\nexport interface IOutput {\n id: string;\n from?: string;\n filter?: IFilter[];\n notify?: string[];\n}\n\nexport interface IDatasource {\n id: string;\n filter?: IFilter[];\n outputs: IOutput[];\n}\n\nexport interface IWorkunitDatasource extends IDatasource {\n WUID: boolean;\n}\nexport function isWorkunitDatasource(ref: IAnyDatasource): ref is IWorkunitDatasource {\n return (ref as IWorkunitDatasource).WUID !== undefined;\n}\n\nexport interface IDatabombDatasource extends IDatasource {\n databomb: true;\n}\nexport function isDatabombDatasource(ref: IAnyDatasource): ref is IDatabombDatasource {\n return (ref as IDatabombDatasource).databomb === true;\n}\n\nexport interface IHipieDatasource extends IDatasource {\n URL: string;\n}\nexport function isHipieDatasource(ref: IAnyDatasource): ref is IHipieDatasource {\n return (ref as IHipieDatasource).URL !== undefined;\n}\n\nexport type IAnyDatasource = IWorkunitDatasource | IDatabombDatasource | IHipieDatasource;\n// Event ====================================================================\nexport interface IEventUpdate {\n visualization: string;\n instance?: string;\n datasource: string;\n col?: string;\n merge: boolean;\n mappings?: StringStringDict;\n}\n\nexport interface IEvent {\n mappings?: StringStringDict; // Legacy\n updates: IEventUpdate[];\n}\n\n// Mappings =================================================================\nexport interface IPieMapping {\n label: string;\n weight: string;\n}\n\nexport interface ILineMapping {\n x: string[];\n y: string[];\n}\n\nexport interface ITableMapping {\n value: string[];\n}\n\nexport interface IChoroMapping {\n weight: string | string[];\n}\n\nexport interface IChoroUSStateMapping extends IChoroMapping {\n state: string;\n}\n\nexport interface IChoroUSCountyMapping extends IChoroMapping {\n county: string;\n}\n\nexport interface IChoroGeohashMapping extends IChoroMapping {\n geohash: string;\n}\n\nexport interface IGraphMapping {\n uid: string;\n label: string;\n weight: string;\n flags: string;\n}\n\nexport interface IGraphLinkMapping {\n uid: string;\n}\n\nexport interface IHeatMapMapping {\n x: string;\n y: string;\n weight: string;\n}\n\nexport interface ISliderMapping {\n label: string;\n}\n// Source ===================================================================\nexport interface ISource {\n id: string;\n output: string;\n sort?: string[];\n first?: string | number;\n reverse?: boolean;\n properties?: StringStringDict; // TODO Needed?\n}\n\nexport interface IPieSource extends ISource {\n mappings: IPieMapping;\n}\n\nexport interface ILineSource extends ISource {\n mappings: ILineMapping;\n}\n\nexport interface ITableSource extends ISource {\n mappings: ITableMapping;\n}\n\nexport interface IGraphLink {\n mappings: IGraphLinkMapping;\n childfile: string;\n}\n\nexport interface IGraphSource extends ISource {\n mappings: IGraphMapping;\n link: IGraphLink;\n}\n\nexport interface IHeatMapSource extends ISource {\n mappings: IHeatMapMapping;\n}\n\nexport interface IChoroSource extends ISource {\n mappings: IAnyChoroMapping;\n}\n\nexport interface ISliderSource extends ISource {\n mappings: ISliderMapping;\n}\n\n// Visualization ============================================================\nexport type VisualizationType = \"PIE\" | \"LINE\" | \"BAR\" | \"TABLE\" | \"CHORO\" | \"GRAPH\" | \"HEAT_MAP\" | \"SLIDER\" | \"SUMMARY\" | \"FORM\" | \"2DCHART\" | \"WORD_CLOUD\" | \"BUBBLE\";\nexport type VisualizationFieldDataType = \"bool\" | \"boolean\" | \"integer\" | \"integer4\" | \"integer8\" | \"unsigned\" | \"unsigned4\" | \"unsigned8\" | \"float\" | \"double\" | \"real\" | \"real4\" | \"real8\" | \"string\" | \"date\" | \"time\" | \"geohash\" | \"dataset\" | \"visualization\";\nexport type VisualizationFieldType = VisualizationFieldDataType | \"range\";\nexport type VisualizationFieldFuncitonType = \"SUM\" | \"AVE\" | \"MIN\" | \"MAX\" | \"SCALE\";\n\nexport interface IVisualizationField {\n id: string;\n properties: {\n label?: string;\n datatype: VisualizationFieldDataType;\n default?: any[];\n function?: VisualizationFieldFuncitonType;\n params?: {\n param1: string;\n param2: string;\n }\n type: VisualizationFieldType;\n };\n}\n\nexport interface IVisualization {\n id: string;\n title?: string;\n type: VisualizationType;\n fields?: IVisualizationField[];\n properties?: {\n charttype?: string,\n\n // TODO Split Known Properties ---\n [key: string]: any\n };\n events?: { [key: string]: IEvent };\n onSelect?: any; // legacy\n color?: any; // legacy\n}\n\nexport interface IPieVisualization extends IVisualization {\n type: \"PIE\" | \"BAR\";\n source: IPieSource;\n}\nexport function isPieVisualization(viz: IAnyVisualization): viz is IPieVisualization {\n return (viz as IPieVisualization).type === \"PIE\" || (viz as IPieVisualization).type === \"BAR\";\n}\n\nexport interface ILineVisualization extends IVisualization {\n type: \"LINE\";\n source: ILineSource;\n}\nexport function isLineVisualization(viz: IAnyVisualization): viz is ILineVisualization {\n return (viz as ILineVisualization).type === \"LINE\";\n}\n\nexport type ChoroColor = \"default\" | \"YlGn\" | \"YlGnBu\" | \"GnBu\" | \"BuGn\" | \"PuBuGn\" | \"PuBu\" | \"BuPu\" | \"RdPu\" | \"PuRd\" | \"OrRd\" | \"YlOrRd\" | \"YlOrBr\" | \"Purples\" | \"Blues\" | \"Greens\" | \"Oranges\" | \"Reds\" | \"Greys\" | \"PuOr\" | \"BrBG\" | \"PRGn\" | \"PiYG\" | \"RdBu\" | \"RdGy\" | \"RdYlBu\" | \"Spectral\" | \"RdYlGn\" | \"RdWhGr\";\nexport interface IChoroVisualization extends IVisualization {\n type: \"CHORO\";\n source: IChoroSource;\n\n visualizations?: IChoroVisualization[];\n color?: ChoroColor;\n}\nexport function isChoroVisualization(viz: IAnyVisualization): viz is IChoroVisualization {\n return (viz as IChoroVisualization).type === \"CHORO\";\n}\n\nexport interface ITableVisualization extends IVisualization {\n type: \"TABLE\";\n label: string[];\n source: ITableSource;\n}\nexport function isTableVisualization(viz: IAnyVisualization): viz is ITableVisualization {\n return (viz as ITableVisualization).type === \"TABLE\";\n}\n\nexport interface ISliderVisualization extends IVisualization {\n type: \"SLIDER\";\n source: ISliderSource;\n range?: number[];\n}\nexport function isSliderVisualization(viz: IAnyVisualization): viz is ISliderVisualization {\n return (viz as ISliderVisualization).type === \"SLIDER\";\n}\n\nexport interface IIcon {\n [id: string]: string | number | boolean;\n}\n\nexport type IValueMappings = { [key: string]: IIcon; };\n\nexport interface IVisualizationIcon {\n fieldid?: string;\n faChar?: string;\n valuemappings?: IValueMappings;\n}\n\nexport interface IGraphVisualization extends IVisualization {\n type: \"GRAPH\";\n source: IGraphSource;\n\n label: string[];\n icon: IVisualizationIcon;\n flag: IVisualizationIcon[];\n}\nexport function isGraphVisualization(viz: IAnyVisualization): viz is IGraphVisualization {\n return (viz as IGraphVisualization).type === \"GRAPH\";\n}\n\nexport interface IHeatMapVisualization extends IVisualization {\n type: \"HEAT_MAP\";\n source: IHeatMapSource;\n}\nexport function isHeatMapVisualization(viz: IAnyVisualization): viz is IHeatMapVisualization {\n return (viz as IHeatMapVisualization).type === \"HEAT_MAP\";\n}\n\nexport interface IFormVisualization extends IVisualization {\n type: \"FORM\";\n}\nexport function isFormVisualization(viz: IAnyVisualization): viz is IFormVisualization {\n return (viz as IFormVisualization).type === \"FORM\";\n}\n\n// Dashboard ================================================================\nexport interface IDashboard {\n id?: string;\n title?: string;\n enable?: string;\n label?: string;\n primary?: boolean;\n visualizations: IAnyVisualization[];\n}\n\nexport interface IDDL {\n dashboards: IDashboard[];\n datasources: IAnyDatasource[];\n hipieversion: string;\n visualizationversion: string;\n}\n\n// DDL ======================================================================\nexport type DDLSchema = IDDL;\n\n// Helpers ==================================================================\nexport type IAnyChoroMapping = IChoroUSStateMapping | IChoroUSCountyMapping | IChoroGeohashMapping;\nexport function isUSStateMapping(mappings: IAnyChoroMapping) {\n return (mappings as IChoroUSStateMapping).state !== undefined;\n}\nexport function isUSCountyMapping(mappings: IAnyChoroMapping) {\n return (mappings as IChoroUSCountyMapping).county !== undefined;\n}\nexport function isGeohashMapping(mappings: IAnyChoroMapping) {\n return (mappings as IChoroGeohashMapping).geohash !== undefined;\n}\nexport type IAnyMapping = IPieMapping | ILineMapping | IGraphMapping | IAnyChoroMapping | ITableMapping | IHeatMapMapping;\nexport type IAnySource = IPieSource | ILineSource | ITableSource | IChoroSource | IGraphSource | IHeatMapSource;\nexport type IAnyVisualization = IPieVisualization | ILineVisualization | ITableVisualization | IChoroVisualization | IGraphVisualization | IHeatMapVisualization | ISliderVisualization | IFormVisualization;\n","export type RowType = { [key: string]: any; };\n\n// Fields ==============================================================\nexport type Number64 = string;\nexport type Range = [number | string, number | string];\nexport type Dataset = any[];\nexport type IFieldType = \"boolean\" | \"number\" | \"number64\" | \"string\" | \"range\" | \"dataset\" | \"set\" | \"object\";\n\nexport interface IFieldBoolean {\n type: \"boolean\";\n id: string;\n default?: boolean;\n}\n\nexport interface IFieldNumber {\n type: \"number\";\n id: string;\n default?: number;\n}\n\nexport interface IFieldNumber64 {\n type: \"number64\";\n id: string;\n default?: Number64;\n}\n\nexport interface IFieldString {\n type: \"string\";\n id: string;\n default?: string;\n}\n\nexport interface IFieldRange {\n type: \"range\";\n id: string;\n default?: Range;\n}\n\nexport interface IFieldDataset {\n type: \"dataset\";\n id: string;\n default?: Dataset;\n children: IField[];\n}\n\nexport interface IFieldSet {\n type: \"set\";\n id: string;\n default?: Array<string | number>;\n fieldType: \"string\" | \"number\";\n}\n\nexport interface IFieldObject {\n type: \"object\";\n id: string;\n default?: object;\n fields: { [key: string]: IField };\n}\n\nexport type IField = IFieldBoolean | IFieldNumber | IFieldNumber64 | IFieldString | IFieldRange | IFieldDataset | IFieldSet | IFieldObject;\n\n// Datasources ==============================================================\nexport type IDatasourceType = \"wuresult\" | \"logicalfile\" | \"roxie\" | \"hipie\" | \"rest\" | \"form\" | \"databomb\";\nexport type DatasourceType = IWUResult | ILogicalFile | IRoxieService | IHipieService | IRestService | IForm | IDatabomb;\n\nexport interface IDatasource {\n type: IDatasourceType;\n id: string;\n}\n\nexport interface IService extends IDatasource {\n url: string;\n}\n\nexport interface IOutput {\n fields: IField[];\n}\n\nexport type OutputDict = { [key: string]: IOutput };\n\nexport interface IWUResult extends IService {\n type: \"wuresult\";\n wuid: string;\n outputs: OutputDict;\n}\n\nexport interface ILogicalFile extends IService {\n type: \"logicalfile\";\n logicalFile: string;\n fields: IField[];\n}\n\nexport interface IRoxieService extends IService {\n type: \"roxie\";\n querySet: string;\n queryID: string;\n inputs: IField[];\n outputs: OutputDict;\n}\n\nexport interface IHipieService extends IService {\n type: \"hipie\";\n querySet: string;\n queryID: string;\n inputs: IField[];\n outputs: OutputDict;\n}\n\nexport interface IRestService extends IService {\n type: \"rest\";\n action: string;\n mode?: \"get\" | \"post\";\n inputs: IField[];\n outputs: OutputDict;\n}\n\nexport interface IForm extends IDatasource {\n type: \"form\";\n fields: IField[];\n}\n\nexport type IDatabombFormat = \"csv\" | \"tsv\" | \"json\";\nexport interface IDatabomb extends IDatasource {\n type: \"databomb\";\n fields: IField[];\n format: IDatabombFormat;\n payload?: string;\n}\n\n// IDatasorceRef ---\nexport interface IDatasourceBaseRef {\n id: string;\n}\n\nexport interface IDatabombRef extends IDatasourceBaseRef {\n}\n\nexport interface IWUResultRef extends IDatasourceBaseRef {\n output: string;\n}\n\nexport interface IRestResultRef extends IDatasourceBaseRef {\n responseField: string;\n}\n\nexport interface IHipieSqlRef extends IDatasourceBaseRef {\n}\n\nexport interface IRequestField {\n localFieldID: string;\n source: string;\n remoteFieldID: string;\n value: string;\n}\n\nexport interface IRoxieServiceRef extends IDatasourceBaseRef {\n request: IRequestField[];\n output: string;\n}\n\nexport type IDatasourceRef = IDatabombRef | IWUResultRef | IRoxieServiceRef | IHipieSqlRef;\n\nexport function isDatabombRef(ref: IDatasourceRef): ref is IDatabombRef {\n return !isWUResultRef(ref) && !isRoxieServiceRef(ref);\n}\n\nexport function isWUResultRef(ref: IDatasourceRef): ref is IWUResultRef {\n return (ref as IWUResultRef).output !== undefined && !isRoxieServiceRef(ref);\n}\n\nexport function isRoxieServiceRef(ref: IDatasourceRef): ref is IRoxieServiceRef {\n return (ref as IRoxieServiceRef).request !== undefined;\n}\n\n// Activities ===============================================================\nexport type IActivityType = \"filter\" | \"project\" | \"groupby\" | \"sort\" | \"limit\" | \"mappings\";\nexport type ActivityType = IFilter | IProject | IGroupBy | ISort | ILimit | IMappings;\n\nexport interface IActivity {\n type: IActivityType;\n}\n\n// Filter ===================================================================\nexport type IMappingConditionType = \"==\" | \"!=\" | \">\" | \">=\" | \"<\" | \"<=\" | \"range\" | \"in\";\nexport interface IMapping {\n remoteFieldID: string;\n localFieldID: string;\n condition: IMappingConditionType;\n nullable: boolean;\n}\n\nexport interface IFilterCondition {\n viewID: string;\n mappings: IMapping[];\n}\n\nexport interface IFilterStaticCondition {\n localFieldID: string;\n condition: IMappingConditionType;\n value: string | number;\n}\n\nexport type FilterCondition = IFilterCondition | IFilterStaticCondition;\nexport function isIFilterCondition(fc: FilterCondition): fc is IFilterCondition {\n return !!(fc as IFilterCondition).viewID;\n}\n\nexport interface IFilter extends IActivity {\n type: \"filter\";\n conditions: FilterCondition[];\n}\nexport function isFilterActivity(activity: IActivity): activity is IFilter {\n return activity.type === \"filter\";\n}\n\n// Project ==================================================================\nexport interface IEquals {\n fieldID: string;\n type: \"=\";\n sourceFieldID: string;\n transformations?: MultiTransformationType[];\n}\nexport type ICalculatedType = \"+\" | \"-\" | \"*\" | \"/\";\nexport interface ICalculated {\n fieldID: string;\n type: ICalculatedType;\n sourceFieldID1: string;\n sourceFieldID2: string;\n}\n\nexport interface IScale {\n fieldID: string;\n type: \"scale\";\n sourceFieldID: string;\n factor: number;\n}\n\nexport interface ITemplate {\n fieldID: string;\n type: \"template\";\n template: string;\n}\n\nexport interface IMapMapping {\n value: any;\n newValue: any;\n}\n\nexport interface IMap {\n fieldID: string;\n type: \"map\";\n sourceFieldID: string;\n default: any;\n mappings: IMapMapping[];\n}\n\nexport type MultiTransformationType = IEquals | ICalculated | IScale | ITemplate | IMap;\nexport interface IMulti {\n fieldID: string;\n type: \"multi\";\n transformations: MultiTransformationType[];\n}\n\nexport type ProjectTransformationType = MultiTransformationType | IMulti;\nexport interface IProject extends IActivity {\n type: \"project\";\n transformations: ProjectTransformationType[];\n}\nexport function isProjectActivity(activity: IActivity): activity is IProject {\n return activity.type === \"project\";\n}\nexport interface IMappings extends IActivity {\n type: \"mappings\";\n transformations: ProjectTransformationType[];\n}\nexport function isMappingsActivity(activity: IActivity): activity is IMappings {\n return activity.type === \"mappings\";\n}\n// GroupBy ==================================================================\nexport type IAggregateType = \"min\" | \"max\" | \"sum\" | \"mean\" | \"variance\" | \"deviation\";\nexport interface IAggregate {\n fieldID: string;\n type: IAggregateType;\n inFieldID: string;\n baseCountFieldID?: string;\n}\n\nexport interface ICount {\n fieldID: string;\n type: \"count\";\n}\n\nexport type AggregateType = IAggregate | ICount;\n\nexport interface IGroupBy extends IActivity {\n type: \"groupby\";\n groupByIDs: string[];\n aggregates: AggregateType[];\n}\nexport function isGroupByActivity(activity: IActivity): activity is IGroupBy {\n return activity.type === \"groupby\";\n}\n\n// Sort =====================================================================\nexport interface ISortCondition {\n fieldID: string;\n descending: boolean;\n}\n\nexport interface ISort extends IActivity {\n type: \"sort\";\n conditions: ISortCondition[];\n}\nexport function isSortActivity(activity: IActivity): activity is ISort {\n return activity.type === \"sort\";\n}\n\n// Limit ====================================================================\nexport interface ILimit extends IActivity {\n type: \"limit\";\n limit: number;\n}\nexport function isLimitActivity(activity: IActivity): activity is ILimit {\n return activity.type === \"limit\";\n}\n\n// Visualization ============================================================\nexport interface IWidgetProperties {\n __class: string;\n [propID: string]: string | string[] | number | boolean | undefined | IWidgetProperties | IWidgetProperties[];\n}\n\nexport interface IWidget {\n id: string;\n chartType: string;\n __class: string;\n properties: IWidgetProperties;\n}\n\nexport type VisibilityType = \"normal\" | \"flyout\";\nexport const VisibilitySet: VisibilityType[] = [\"normal\", \"flyout\"];\n\nexport interface IVisualization extends IWidget {\n title: string;\n description?: string;\n visibility: VisibilityType;\n mappings: IMappings;\n secondaryDataviewID?: string;\n}\n\n// View =====================================================================\nexport interface IView {\n id: string;\n datasource: IDatasourceRef;\n activities: ActivityType[];\n visualization: IVisualization;\n}\n\n// DDL ======================================================================\nexport interface IProperties {\n [propID: string]: any;\n}\n\nexport interface Schema {\n version: \"2.2.1\";\n createdBy: {\n name: string;\n version: string;\n };\n datasources: DatasourceType[];\n dataviews: IView[];\n properties?: IProperties;\n hipieProperties?: IProperties;\n\n // The following defs are only provided to assist the Java code generation (from the the generated schema) ---\n defs?: {\n fieldTypes: {\n number64: Number64;\n range: Range;\n dataset: Dataset;\n fieldType: IFieldType;\n fieldBoolean: IFieldBoolean;\n fieldNumber: IFieldNumber;\n fieldNumber64: IFieldNumber64\n fieldString: IFieldString;\n fieldRange: IFieldRange;\n fieldDataset: IFieldDataset;\n fieldSet: IFieldSet;\n fieldObject: IFieldObject;\n field: IField;\n };\n datasourceTypes: {\n datasource: IDatasource;\n logicalFile: ILogicalFile;\n form: IForm;\n databomb: IDatabomb;\n wuresult: IWUResult;\n hipieService: IHipieService;\n roxieService: IRoxieService;\n };\n datasourceRefTypes: {\n wuResultRef: IWUResultRef;\n roxieServiceRef: IRoxieServiceRef;\n };\n activityTypes: {\n filter: IFilter;\n project: IProject;\n groupby: IGroupBy;\n sort: ISort;\n limit: ILimit;\n mappings: IMappings;\n };\n aggregateTypes: {\n aggregate: IAggregate;\n count: ICount;\n };\n transformationTypes: {\n equals: IEquals;\n calculated: ICalculated;\n scale: IScale;\n template: ITemplate;\n map: IMap;\n multi: IMulti;\n };\n };\n}\n","import * as DDL2 from \"./ddl/v2.ts\";\n\nconst classMappings: any = {\n c3chart_Bar: \"chart_Bar\",\n c3chart_Column: \"chart_Column\",\n c3chart_Pie: \"chart_Pie\",\n c3chart_Area: \"chart_Area\",\n c3chart_Line: \"chart_Line\",\n amchart_Bar: \"chart_Bar\",\n amchart_Column: \"chart_Column\",\n amchart_Pie: \"chart_Pie\",\n amchart_Area: \"chart_Area\",\n amchart_Line: \"chart_Line\",\n google_Bar: \"chart_Bar\",\n google_Column: \"chart_Column\",\n google_Pie: \"chart_Pie\",\n google_Area: \"chart_Area\",\n google_Line: \"chart_Line\",\n other_Table: \"dgrid_Table\"\n};\nconst propertyMappings: any = {\n xAxisLabelRotation: [\n { name: \"xAxisOverlapMode\", transform: (n: any) => \"rotate\" },\n { name: \"xAxisLabelRotation\", transform: (n: any) => n }\n ],\n tooltipLabelColor: {\n name: \"tooltipLabelColor\"\n },\n tooltipSeriesColor: {\n name: \"tooltipSeriesColor\"\n },\n tooltipValueColor: {\n name: \"tooltipValueColor\"\n },\n tooltipValueFormat: {\n name: \"tooltipValueFormat\"\n },\n timePattern: {\n name: \"xAxisTypeTimePattern\"\n },\n smoothLines: {\n name: \"interpolate\",\n transform: (n: any) => {\n if (n === false) return \"linear\";\n return \"catmullRom\";\n }\n },\n holePercent: {\n name: \"innerRadius\"\n },\n flip: {\n name: \"orientation\",\n transform: (n: any) => n ? \"vertical\" : \"horizontal\"\n },\n bottomText: {\n name: \"xAxisTitle\"\n },\n xAxisTypeTimePattern: {\n name: \"xAxisTypeTimePattern\"\n },\n yAxisTypeTimePattern: {\n name: \"yAxisTypeTimePattern\"\n },\n valueFormat: {\n name: \"tooltipValueFormat\"\n },\n stacked: {\n name: \"yAxisStacked\"\n },\n showYGrid: {\n name: \"yAxisGuideLines\"\n },\n showXGrid: {\n name: \"xAxisGuideLines\"\n },\n showValueLabel: {\n name: \"showValue\"\n },\n low: {\n name: \"yAxisDomainLow\"\n },\n high: {\n name: \"yAxisDomainHigh\"\n },\n fillOpacity: {\n name: \"interpolateFillOpacity\"\n },\n areaFillOpacity: {\n name: \"interpolateFillOpacity\"\n },\n showToolbar: {\n name: \"titleVisible\"\n },\n showCSV: {\n name: \"downloadButtonVisible\"\n }\n};\n\nfunction findKeyVal(object: any, key: any, val: any): any {\n let value;\n\n for (const k in object) {\n if (k === key && object[k] === val) {\n value = object;\n break;\n }\n if (object[k] && typeof object[k] === \"object\") {\n value = findKeyVal(object[k], key, val);\n if (value !== undefined) {\n break;\n }\n }\n }\n return value;\n}\n\nfunction apply_to_dataviews(ddl2: DDL2.Schema, dermObj: any) {\n\n ddl2.dataviews.forEach(apply_to_dataview);\n\n function apply_to_dataview(dv: any) {\n const widgetId = dv.id;\n const dermPanelObj: any = findKeyVal(dermObj, \"__id\", widgetId);\n if (dermPanelObj) {\n const dermPanelProps: any = dermPanelObj.__properties;\n const dermWidgetObj: any = dermPanelObj.__properties.chart ? dermPanelObj.__properties.chart : dermPanelObj.__properties.widget;\n const dermWidgetProps: any = dermWidgetObj.__properties;\n apply_class_mapping(dermWidgetObj);\n apply_panel_property_mapping(dermPanelProps, dermWidgetProps);\n apply_widget_property_mapping(dermPanelProps, dermWidgetProps);\n if (dv.visualization.properties.chartType) {\n dv.visualization.properties.charttype = dv.visualization.properties.chartType;\n }\n } else {\n console.warn(widgetId + \" not found in dermObj\");\n }\n\n function apply_class_mapping(dermWidgetObj: any) {\n dv.visualization.__class = swap_with_supported_class(dermWidgetObj.__class);\n dv.visualization.properties.__class = \"marshaller_VizChartPanel\";\n if (!dv.visualization.properties.widget) dv.visualization.properties.widget = {};\n dv.visualization.properties.widget.__class = dv.visualization.__class;\n\n function swap_with_supported_class(_class: string): string {\n return classMappings[_class] ? classMappings[_class] : _class;\n }\n }\n function apply_panel_property_mapping(dermPanelProps: any, dermWidgetProps: any) {\n dv.visualization.title = dermPanelProps.title || \"\";\n dv.visualization.description = \"\";\n dv.visualization.visibility = dv.visualization.visibility === \"flyout\" ? \"flyout\" : \"normal\";\n dv.visualization.chartType = dv.visualization.__class.split(\"_\")[1];\n for (const propName in dermPanelProps) {\n if (typeof propertyMappings[propName] !== \"undefined\") {\n const newPropName = propertyMappings[propName].name;\n\n if (typeof propertyMappings[propName].transform === \"function\") {\n dv.visualization.properties[newPropName] = propertyMappings[propName].transform(dermPanelProps[propName]);\n } else {\n dv.visualization.properties[newPropName] = dermPanelProps[propName];\n }\n\n }\n }\n if (dermWidgetProps && dermWidgetProps.showLegend && dv.visualization.properties) {\n dv.visualization.properties.legendVisible = true;\n }\n }\n function apply_widget_property_mapping(dermPanelProps: any, dermWidgetProps: any) {\n dv.visualization.title = dv.visualization.title || dermWidgetProps.title || \"\";\n dv.visualization.description = \"\"; // TODO - should this map to anything?\n dv.visualization.visibility = dv.visualization.visibility === \"flyout\" ? \"flyout\" : \"normal\";\n dv.visualization.chartType = dv.visualization.__class.split(\"_\")[1];\n for (const propName in dermWidgetProps) {\n if (typeof propertyMappings[propName] !== \"undefined\") {\n if (propertyMappings[propName] instanceof Array) {\n propertyMappings[propName].forEach((p: any) => {\n const newPropName = p.name;\n dv.visualization.properties.widget[newPropName] = p.transform(dermWidgetProps[propName]);\n if (typeof propertyMappings[propName].transform === \"function\") {\n dv.visualization.properties.widget[newPropName] = propertyMappings[propName].transform(dermWidgetProps[propName]);\n } else {\n dv.visualization.properties.widget[newPropName] = dermWidgetProps[propName];\n }\n });\n } else {\n const newPropName = propertyMappings[propName].name;\n dv.visualization.properties.widget[newPropName] = propertyMappings[propName].transform(dermWidgetProps[propName]);\n }\n }\n }\n }\n }\n}\n\ntype CellPosition = {\n id: string;\n position: [number, number, number, number];\n};\n\ntype DDLProperties = {\n layout: CellPosition[]\n};\n\nfunction apply_to_properties_layout(ddl2: DDL2.Schema, dermObj: any) {\n const retVal: DDLProperties = {\n layout: []\n };\n if (!dermObj || !dermObj.__properties) return;\n dermObj.__properties.content.forEach((cell: any) => {\n const cellPosition: CellPosition = {\n // TODO - if \"id\" could be avoided then layouts could apply to any dashboard with the same number of widgets\n id: cell.__properties.widget.__id,\n position: [\n cell.__properties.gridCol,\n cell.__properties.gridRow,\n cell.__properties.gridColSpan,\n cell.__properties.gridRowSpan\n ]\n };\n retVal.layout.push(cellPosition);\n });\n return retVal;\n}\n\nexport function upgrade(ddl2: DDL2.Schema, dermObj: any) {\n apply_to_dataviews(ddl2, dermObj);\n return apply_to_properties_layout(ddl2, dermObj);\n}\n","import { PKG_NAME, PKG_VERSION } from \"./__package__.ts\";\nimport * as DDL1 from \"./ddl/v1.ts\";\nimport * as DDL2 from \"./ddl/v2.ts\";\nimport { upgrade as dermatologyUpgrade } from \"./dermatology.ts\";\n\ninterface IDatasourceOutput {\n datasource: DDL1.IAnyDatasource;\n output: DDL1.IOutput;\n}\n\ninterface IDatasourceOutputFilter extends IDatasourceOutput {\n filter: DDL1.IFilter;\n}\n\nconst UPGRADE_HEX_CHAR: boolean = false;\nfunction faCharFix(faChar: any): string | undefined {\n if (UPGRADE_HEX_CHAR && typeof faChar === \"string\") {\n return String.fromCharCode(parseInt(faChar));\n }\n return faChar;\n}\n\nclass DDLUpgrade {\n _ddl: DDL1.IDDL;\n _baseUrl: string;\n _wuid?: string;\n _toLowerCase: boolean;\n\n _datasources: { [id: string]: DDL1.IAnyDatasource } = {};\n _datasourceUpdates: { [id: string]: { id: string, output?: string } } = {};\n _visualizations: { [id: string]: DDL1.IAnyVisualization } = {};\n\n _ddl2Datasources: { [id: string]: DDL2.DatasourceType } = {};\n _ddl2DatasourceFields: { [dsid: string]: { [outputID: string]: { [fieldID: string]: DDL2.IField } } } = {};\n\n _ddl2Dataviews: { [id: string]: DDL2.IView } = {};\n _ddl2DataviewActivities: {\n [viewID: string]: {\n project: DDL2.IProject,\n filters: DDL2.IFilter,\n sort: DDL2.ISort,\n groupBy: DDL2.IGroupBy,\n limit: DDL2.ILimit,\n mappings: DDL2.IMappings\n }\n } = {};\n\n constructor(ddl: DDL1.IDDL, baseUrl: string = \"http://localhost:8010\", wuid: string = \"WUID\", toLowerCase = true) {\n this._ddl = ddl;\n this._baseUrl = baseUrl;\n this._wuid = wuid;\n this._toLowerCase = toLowerCase;\n\n this.indexDDL();\n this.readDDL();\n }\n\n toLowerCase(s: string): string {\n return this._toLowerCase ? s.toLowerCase() : s;\n }\n\n isVizDatasourceRoxie(viz: DDL1.IAnyVisualization): boolean {\n if ((viz as any).source) {\n const ds = this._datasources[(viz as any).source.id];\n if (DDL1.isHipieDatasource(ds)) {\n return true;\n }\n }\n return false;\n }\n\n getDatasourceOutputs(dsID: string, vizID: string): IDatasourceOutput[] {\n const retVal: IDatasourceOutput[] = [];\n const datasource = this._datasources[dsID];\n for (const output of datasource.outputs) {\n if (output.notify) {\n for (const notify of output.notify) {\n if (notify === vizID) {\n retVal.push({\n datasource,\n output\n });\n }\n }\n }\n }\n return retVal;\n }\n\n getDatasourceFilters(dsID: string, vizID: string): { [id: string]: IDatasourceOutputFilter } {\n const retVal: { [id: string]: IDatasourceOutputFilter } = {};\n for (const dsOut of this.getDatasourceOutputs(dsID, vizID)) {\n if (dsOut.output.filter) {\n for (const filter of dsOut.output.filter) {\n retVal[filter.fieldid] = {\n datasource: dsOut.datasource,\n output: dsOut.output,\n filter\n };\n }\n }\n }\n return retVal;\n }\n\n indexDDL() {\n for (const dash of this._ddl.dashboards) {\n for (const viz of dash.visualizations) {\n this._visualizations[viz.id] = viz;\n }\n }\n\n for (const ds of this._ddl.datasources) {\n this._datasources[ds.id] = ds;\n for (const output of ds.outputs) {\n if (output.notify) {\n for (const notify of output.notify) {\n this._datasourceUpdates[notify] = {\n id: ds.id,\n output: output.from || output.id\n };\n }\n }\n }\n }\n }\n\n readDDL() {\n for (const ds of this._ddl.datasources) {\n if (DDL1.isWorkunitDatasource(ds)) {\n const ddl2DS: DDL2.IWUResult = {\n type: \"wuresult\",\n id: ds.id,\n url: this._baseUrl,\n wuid: this._wuid!,\n outputs: {}\n };\n for (const output of ds.outputs) {\n this.output2output(output, ddl2DS.outputs);\n }\n this._ddl2Datasources[ds.id] = ddl2DS;\n } else if (DDL1.isDatabombDatasource(ds)) {\n } else {\n const urlParts = ds.URL!.split(\"/WsEcl/submit/query/\");\n const hostParts = urlParts[0];\n const roxieParts = urlParts[1].split(\"/\");\n const ddl2DS: DDL2.IHipieService = {\n type: \"hipie\",\n id: ds.id,\n url: hostParts,\n querySet: roxieParts[0],\n queryID: roxieParts[1],\n inputs: [],\n outputs: {}\n };\n for (const output of ds.outputs) {\n this.output2output(output, ddl2DS.outputs);\n }\n this._ddl2Datasources[ds.id] = ddl2DS;\n }\n }\n for (const dash of this._ddl.dashboards) {\n for (const viz of dash.visualizations) {\n if (viz.type === \"FORM\") {\n this._ddl2Datasources[viz.id] = {\n type: \"form\",\n id: viz.id,\n fields: this.formFields2field(viz.fields)\n };\n this._datasourceUpdates[viz.id] = { id: viz.id };\n } else if (viz.type === \"SLIDER\") {\n this._ddl2Datasources[viz.id] = {\n type: \"form\",\n id: viz.id,\n fields: this.formFields2field(viz.fields, true)\n };\n this._datasourceUpdates[viz.id] = { id: viz.id };\n }\n\n this._ddl2Dataviews[viz.id] = this.anyViz2view(viz);\n }\n }\n\n this.readGroupBy();\n this.readFilters();\n this.readSort();\n this.readMappings();\n }\n\n readGroupBy() {\n for (const dash of this._ddl.dashboards) {\n for (const viz of dash.visualizations) {\n if (viz.fields) {\n const projectTransformations: DDL2.ProjectTransformationType[] = [];\n const groupByColumns: string[] = [];\n const aggrFields: DDL2.IAggregate[] = [];\n for (const field of viz.fields) {\n if (field.properties && field.properties.function) {\n switch (field.properties.function) {\n case \"SUM\":\n case \"MIN\":\n case \"MAX\":\n aggrFields.push({\n type: this.func2aggr(field.properties.function),\n inFieldID: this.toLowerCase(field.properties.params!.param1),\n fieldID: this.toLowerCase(field.id)\n } as DDL2.IAggregate);\n break;\n case \"AVE\":\n aggrFields.push({\n type: this.func2aggr(field.properties.function),\n inFieldID: this.toLowerCase(field.properties.params!.param1),\n baseCountFieldID: field.properties.params!.param2 ? this.toLowerCase(field.properties.params!.param2) : undefined,\n fieldID: this.toLowerCase(field.id)\n } as DDL2.IAggregate);\n break;\n case \"SCALE\":\n if (typeof field.properties.params!.param1 === \"object\") {\n const props: any = field.properties.params!.param1;\n switch (props.function) {\n case \"SUM\":\n case \"MIN\":\n case \"MAX\":\n aggrFields.push({\n type: this.func2aggr(props.function),\n inFieldID: this.toLowerCase(props.params.param1),\n fieldID: this.toLowerCase(field.id)\n });\n break;\n }\n }\n projectTransformations.push({\n type: \"scale\",\n sourceFieldID: this.toLowerCase(field.id),\n fieldID: this.toLowerCase(field.id),\n factor: +field.properties.params!.param2\n });\n break;\n default:\n groupByColumns.push(this.toLowerCase(field.id));\n throw new Error(`Unhandled field function: ${field.properties.function}`);\n }\n } else {\n groupByColumns.push(this.toLowerCase(field.id));\n }\n }\n if (projectTransformations.length) {\n this._ddl2DataviewActivities[viz.id].project.transformations = projectTransformations;\n }\n if (aggrFields.length) {\n this._ddl2DataviewActivities[viz.id].groupBy.groupByIDs = [...groupByColumns];\n this._ddl2DataviewActivities[viz.id].groupBy.aggregates = aggrFields;\n }\n }\n }\n }\n }\n\n func2aggr(func: DDL1.VisualizationFieldFuncitonType): DDL2.IAggregateType {\n switch (func) {\n case \"SUM\":\n return \"sum\";\n case \"AVE\":\n return \"mean\";\n case \"MIN\":\n return \"min\";\n case \"MAX\":\n return \"max\";\n }\n throw new Error(`Unknown DDL1 Function Type: ${func}`);\n }\n\n readMappings() {\n for (const dash of this._ddl.dashboards) {\n for (const viz of dash.visualizations) {\n if (DDL1.isFormVisualization(viz)) {\n } else if (DDL1.isPieVisualization(viz)) {\n this.readPieMappings(viz);\n } else if (DDL1.isChoroVisualization(viz)) {\n this.readChoroMappings(viz);\n } else if (DDL1.isLineVisualization(viz)) {\n this.readLineMappings(viz);\n } else if (DDL1.isTableVisualization(viz)) {\n this.readTableMappings(viz);\n } else if (DDL1.isGraphVisualization(viz)) {\n this.readGraphMappings(viz);\n } else if (DDL1.isSliderVisualization(viz)) {\n this.readSliderMappings(viz);\n } else {\n throw new Error(`Unkown DDL1 mapping type: ${viz.type}`);\n }\n }\n }\n }\n\n readPieMappings(viz: DDL1.IPieVisualization) {\n const mappings = this._ddl2DataviewActivities[viz.id].mappings;\n mappings.transformations.push({\n fieldID: \"label\",\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.mappings.label)\n });\n mappings.transformations.push({\n fieldID: \"weight\",\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.mappings.weight[0])\n });\n }\n\n readChoroMappings(viz: DDL1.IChoroVisualization) {\n const mappings = this._ddl2DataviewActivities[viz.id].mappings;\n mappings.transformations.push({\n fieldID: \"label\",\n type: \"=\",\n sourceFieldID: this.toLowerCase(this.anyChoroMapping2label(viz.source.mappings))\n });\n mappings.transformations.push({\n fieldID: \"weight\",\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.mappings.weight[0])\n });\n }\n\n anyChoroMapping2label(mapping: any) {\n return mapping.state || mapping.county || mapping.geohash;\n }\n\n readLineMappings(viz: DDL1.ILineVisualization) {\n const mappings = this._ddl2DataviewActivities[viz.id].mappings;\n mappings.transformations.push({\n fieldID: viz.source.mappings.x[0],\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.mappings.x[0])\n });\n for (let i = 0; i < viz.source.mappings.y.length; ++i) {\n mappings.transformations.push({\n fieldID: viz.source.mappings.y[i],\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.mappings.y[i])\n });\n }\n }\n\n readTableMappings(viz: DDL1.ITableVisualization) {\n const mappings = this._ddl2DataviewActivities[viz.id].mappings;\n for (let i = 0; i < viz.label.length; ++i) {\n mappings.transformations.push({\n fieldID: viz.label[i],\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.mappings.value[i])\n });\n }\n }\n\n readGraphEnums(valueMappings?: DDL1.IValueMappings, annotation: boolean = false): DDL2.IMapMapping[] {\n const retVal: DDL2.IMapMapping[] = [];\n if (valueMappings) {\n for (const value in valueMappings) {\n const newValue: { [key: string]: string | number | boolean | undefined } = {};\n for (const key in valueMappings[value]) {\n if (key === \"faChar\") {\n newValue[key] = faCharFix(valueMappings[value][key]);\n } else if (annotation && key.indexOf(\"icon_\") === 0) {\n console.warn(\"Deprecated flag property: \" + key);\n newValue[key.split(\"icon_\")[1]] = valueMappings[value][key];\n } else {\n newValue[key] = valueMappings[value][key];\n }\n }\n // remove v1.x \"0\" annotations as they equated to \"nothing\" ---\n if (!annotation || value !== \"0\") {\n retVal.push({\n value,\n newValue\n });\n }\n }\n }\n return retVal;\n }\n\n readGraphMappings(viz: DDL1.IGraphVisualization) {\n const mappings = this._ddl2DataviewActivities[viz.id].mappings;\n mappings.transformations.push({\n fieldID: \"uid\",\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.mappings.uid)\n });\n mappings.transformations.push({\n fieldID: \"label\",\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.mappings.label)\n });\n if (viz.icon.fieldid) {\n mappings.transformations.push({\n fieldID: \"icon\",\n type: \"map\",\n sourceFieldID: this.toLowerCase(viz.icon.fieldid),\n default: { fachar: faCharFix(viz.icon.faChar) },\n mappings: this.readGraphEnums(viz.icon.valuemappings)\n });\n }\n let idx = 0;\n if (viz.flag) {\n for (const flag of viz.flag) {\n if (flag.fieldid) {\n mappings.transformations.push({\n fieldID: `annotation_${idx++}`,\n type: \"map\",\n sourceFieldID: this.toLowerCase(flag.fieldid),\n default: {},\n mappings: this.readGraphEnums(flag.valuemappings, true)\n });\n }\n }\n }\n mappings.transformations.push({\n fieldID: \"links\",\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.link.childfile),\n transformations: [{\n fieldID: \"uid\",\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.link.mappings.uid)\n }]\n });\n }\n\n readSliderMappings(viz: DDL1.ISliderVisualization) {\n const mappings = this._ddl2DataviewActivities[viz.id].mappings;\n mappings.transformations.push({\n fieldID: \"label\",\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.mappings.label)\n });\n }\n\n readFilters() {\n for (const dash of this._ddl.dashboards) {\n for (const viz of dash.visualizations) {\n if (viz.events) {\n for (const eventID in viz.events) {\n const event = viz.events[eventID];\n for (const update of event.updates) {\n const otherViz = this._ddl2Dataviews[update.visualization];\n const dsFilters = this.getDatasourceFilters(update.datasource, otherViz.id);\n if (update.mappings) {\n if (DDL2.isRoxieServiceRef(otherViz.datasource)) {\n for (const key in update.mappings) {\n otherViz.datasource.request.push({\n source: viz.id,\n remoteFieldID: this.toLowerCase(key),\n localFieldID: this.toLowerCase(update.mappings[key])\n } as DDL2.IRequestField);\n }\n } else {\n const condition: DDL2.IFilterCondition = {\n viewID: viz.id,\n mappings: []\n };\n for (const key in update.mappings) {\n const mapping = update.mappings[key];\n const dsFilter = (mapping && dsFilters[mapping]) ? dsFilters[mapping].filter : undefined;\n if (!dsFilter) {\n console.warn(`Select Mapping \"${mapping}\" in viz \"${viz.id}\" not found in filters for \"${otherViz.id}\"`);\n } else {\n condition.mappings.push({\n remoteFieldID: this.toLowerCase(key),\n localFieldID: this.toLowerCase(update.mappings[key]),\n condition: this.rule2condition(dsFilter.rule),\n nullable: dsFilter.nullable\n });\n }\n }\n this._ddl2DataviewActivities[otherViz.id].filters.conditions.push(condition);\n }\n }\n }\n }\n }\n }\n }\n }\n\n rule2condition(_: DDL1.IFilterRule): DDL2.IMappingConditionType {\n switch (_) {\n case \"set\":\n return \"in\";\n case \"notequals\":\n return \"!=\";\n }\n return _;\n }\n\n readSort() {\n for (const dash of this._ddl.dashboards) {\n for (const viz of dash.visualizations) {\n if ((viz as any).source) {\n if ((viz as any).source.sort) {\n const vizSort = this._ddl2DataviewActivities[viz.id].sort;\n vizSort.conditions = ((viz as any).source.sort as string[]).map(s => {\n if (s.indexOf(\"-\") === 0) {\n return {\n fieldID: this.toLowerCase(s.substr(1)),\n descending: true\n } as DDL2.ISortCondition;\n }\n return {\n fieldID: this.toLowerCase(s),\n descending: false\n } as DDL2.ISortCondition;\n });\n }\n if ((viz as any).source.first) {\n const vizLimit = this._ddl2DataviewActivities[viz.id].limit;\n vizLimit.limit = +(viz as any).source.first;\n }\n }\n }\n }\n }\n\n anyViz2view(viz: DDL1.IAnyVisualization): DDL2.IView {\n const project: DDL2.IProject = {\n type: \"project\",\n transformations: []\n };\n const filters: DDL2.IFilter = {\n type: \"filter\",\n conditions: []\n };\n const groupBy: DDL2.IGroupBy = {\n type: \"groupby\",\n groupByIDs: [],\n aggregates: []\n };\n const sort: DDL2.ISort = {\n type: \"sort\",\n conditions: []\n };\n const limit: DDL2.ILimit = {\n type: \"limit\",\n limit: 0\n };\n const mappings: DDL2.IMappings = {\n type: \"mappings\",\n transformations: []\n };\n this._ddl2DataviewActivities[viz.id] = {\n project,\n filters,\n sort,\n groupBy,\n limit,\n mappings\n };\n const datasourceRef: DDL2.IDatasourceBaseRef | DDL2.IRoxieServiceRef = this.isVizDatasourceRoxie(viz) ? {\n id: this._datasourceUpdates[viz.id].id,\n request: [],\n output: this._datasourceUpdates[viz.id].output\n } : {\n id: this._datasourceUpdates[viz.id].id,\n output: this._datasourceUpdates[viz.id].output\n };\n return {\n id: viz.id,\n datasource: datasourceRef,\n activities: [\n project,\n filters,\n sort,\n groupBy,\n limit\n ],\n visualization: {\n id: viz.id,\n title: viz.title || \"\",\n description: \"\",\n visibility: viz.properties && viz.properties.flyout === true ? \"flyout\" : \"normal\",\n ...this.type2chartType(viz.type),\n mappings,\n properties: (viz.properties || {}) as DDL2.IWidgetProperties\n }\n };\n }\n\n type2chartType(chartType: DDL1.VisualizationType): { chartType: string, __class: string } {\n switch (chartType) {\n case \"LINE\":\n return { chartType: \"Line\", __class: \"chart_Line\" };\n case \"BUBBLE\":\n return { chartType: \"Bubble\", __class: \"chart_Bubble\" };\n case \"PIE\":\n return { chartType: \"Pie\", __class: \"chart_Pie\" };\n case \"BAR\":\n return { chartType: \"Column\", __class: \"chart_Column\" };\n case \"FORM\":\n return { chartType: \"FieldForm\", __class: \"form_FieldForm\" };\n case \"WORD_CLOUD\":\n return { chartType: \"WordCloud\", __class: \"chart_WordCloud\" };\n case \"CHORO\":\n return { chartType: \"ChoroplethStates\", __class: \"map_ChoroplethStates\" };\n case \"SUMMARY\":\n return { chartType: \"Summary\", __class: \"chart_Summary\" };\n case \"SLIDER\":\n return { chartType: \"FieldForm\", __class: \"form_FieldForm\" };\n case \"HEAT_MAP\":\n return { chartType: \"HeatMap\", __class: \"other_HeatMap\" };\n case \"2DCHART\":\n return { chartType: \"Column\", __class: \"chart_Column\" };\n case \"GRAPH\":\n return { chartType: \"AdjacencyGraph\", __class: \"graph_AdjacencyGraph\" };\n case \"TABLE\":\n default:\n return { chartType: \"Table\", __class: \"dgrid_Table\" };\n }\n }\n\n formFields2field(fields?: DDL1.IVisualizationField[], slider: boolean = false): DDL2.IField[] {\n if (!fields) return [];\n return fields.map(field => {\n switch (field.properties.type) {\n case \"range\":\n return {\n type: \"range\",\n id: field.id,\n default: (field.properties.default ? field.properties.default as DDL2.Range : undefined)\n };\n case \"dataset\":\n return {\n type: \"dataset\",\n id: field.id,\n default: [],\n children: []\n };\n default:\n return {\n type: this.formFieldType2fieldType(field.properties.datatype, slider),\n id: field.id,\n default: field.properties.default ? field.properties.default[0] : undefined\n };\n }\n });\n }\n\n formFieldType2fieldType(fieldType: DDL1.VisualizationFieldType, slider: boolean): \"string\" | \"number\" | \"boolean\" {\n switch (fieldType) {\n case \"bool\":\n case \"boolean\":\n return \"boolean\";\n case \"integer\":\n case \"unsigned\":\n case \"float\":\n case \"double\":\n case \"real\":\n return \"number\";\n case \"string\":\n return \"string\";\n default:\n return slider ? \"number\" : \"string\";\n }\n }\n\n output2output(output: DDL1.IOutput, target: DDL2.OutputDict) {\n target[output.from || output.id] = {\n fields: this.filters2fields(output.filter)\n };\n }\n\n filters2fields(filters?: DDL1.IFilter[]): DDL2.IField[] {\n if (!filters) return [];\n return filters.filter(filter => {\n const idParts = filter.fieldid.split(\"-\");\n return idParts.length === 1 || idParts[1] === \"range\";\n }).map(filter => {\n const idParts = filter.fieldid.split(\"-\");\n const retVal: DDL2.IFieldString = {\n type: \"string\",\n id: idParts[0]\n };\n return retVal;\n });\n }\n\n getVizField(vizID: string, fieldID: string): DDL2.IField {\n return {\n type: \"string\",\n id: \"\",\n default: \"\"\n };\n }\n\n writeDatasources(): DDL2.DatasourceType[] {\n const retVal: DDL2.DatasourceType[] = [];\n for (const id in this._ddl2Datasources) {\n retVal.push(this._ddl2Datasources[id]);\n }\n return retVal;\n }\n\n writeDataviews(): DDL2.IView[] {\n const retVal: DDL2.IView[] = [];\n for (const id in this._ddl2Dataviews) {\n retVal.push(this._ddl2Dataviews[id]);\n }\n return retVal;\n }\n\n writeProperties(): DDL2.IProperties | undefined {\n return {\n // TODO\n };\n }\n\n write(): DDL2.Schema {\n return {\n version: \"2.2.1\",\n createdBy: {\n name: PKG_NAME,\n version: PKG_VERSION\n },\n datasources: this.writeDatasources(),\n dataviews: this.writeDataviews(),\n properties: this.writeProperties()\n };\n }\n}\n\nexport function upgrade(ddl: DDL1.IDDL, baseUrl?: string, wuid?: string, toLowerCase: boolean = true, dermatologyJson = {}): DDL2.Schema {\n const ddlUp = new DDLUpgrade(ddl, baseUrl, wuid, toLowerCase);\n const retVal = ddlUp.write();\n retVal.properties = dermatologyUpgrade(retVal, dermatologyJson);\n return retVal;\n}\n","{\n \"$ref\": \"#/definitions/Schema\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"definitions\": {\n \"ActivityType\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/IFilter\"\n },\n {\n \"$ref\": \"#/definitions/IProject\"\n },\n {\n \"$ref\": \"#/definitions/IGroupBy\"\n },\n {\n \"$ref\": \"#/definitions/ISort\"\n },\n {\n \"$ref\": \"#/definitions/ILimit\"\n },\n {\n \"$ref\": \"#/definitions/IMappings\"\n }\n ]\n },\n \"AggregateType\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/IAggregate\"\n },\n {\n \"$ref\": \"#/definitions/ICount\"\n }\n ]\n },\n \"Dataset\": {\n \"items\": {},\n \"type\": \"array\"\n },\n \"DatasourceType\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/IWUResult\"\n },\n {\n \"$ref\": \"#/definitions/ILogicalFile\"\n },\n {\n \"$ref\": \"#/definitions/IRoxieService\"\n },\n {\n \"$ref\": \"#/definitions/IHipieService\"\n },\n {\n \"$ref\": \"#/definitions/IRestService\"\n },\n {\n \"$ref\": \"#/definitions/IForm\"\n },\n {\n \"$ref\": \"#/definitions/IDatabomb\"\n }\n ]\n },\n \"FilterCondition\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/IFilterCondition\"\n },\n {\n \"$ref\": \"#/definitions/IFilterStaticCondition\"\n }\n ]\n },\n \"IAggregate\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"baseCountFieldID\": {\n \"type\": \"string\"\n },\n \"fieldID\": {\n \"type\": \"string\"\n },\n \"inFieldID\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"$ref\": \"#/definitions/IAggregateType\"\n }\n },\n \"required\": [\n \"fieldID\",\n \"type\",\n \"inFieldID\"\n ],\n \"type\": \"object\"\n },\n \"IAggregateType\": {\n \"enum\": [\n \"min\",\n \"max\",\n \"sum\",\n \"mean\",\n \"variance\",\n \"deviation\"\n ],\n \"type\": \"string\"\n },\n \"ICalculated\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"fieldID\": {\n \"type\": \"string\"\n },\n \"sourceFieldID1\": {\n \"type\": \"string\"\n },\n \"sourceFieldID2\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"$ref\": \"#/definitions/ICalculatedType\"\n }\n },\n \"required\": [\n \"fieldID\",\n \"type\",\n \"sourceFieldID1\",\n \"sourceFieldID2\"\n ],\n \"type\": \"object\"\n },\n \"ICalculatedType\": {\n \"enum\": [\n \"+\",\n \"-\",\n \"*\",\n \"/\"\n ],\n \"type\": \"string\"\n },\n \"ICount\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"fieldID\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"const\": \"count\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"fieldID\",\n \"type\"\n ],\n \"type\": \"object\"\n },\n \"IDatabomb\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"fields\": {\n \"items\": {\n \"$ref\": \"#/definitions/IField\"\n },\n \"type\": \"array\"\n },\n \"format\": {\n \"$ref\": \"#/definitions/IDatabombFormat\"\n },\n \"id\": {\n \"type\": \"string\"\n },\n \"payload\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"const\": \"databomb\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"fields\",\n \"format\",\n \"id\",\n \"type\"\n ],\n \"type\": \"object\"\n },\n \"IDatabombFormat\": {\n \"enum\": [\n \"csv\",\n \"tsv\",\n \"json\"\n ],\n \"type\": \"string\"\n },\n \"IDatabombRef\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\"\n ],\n \"type\": \"object\"\n },\n \"IDatasource\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"$ref\": \"#/definitions/IDatasourceType\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"type\": \"object\"\n },\n \"IDatasourceRef\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/IDatabombRef\"\n },\n {\n \"$ref\": \"#/definitions/IWUResultRef\"\n },\n {\n \"$ref\": \"#/definitions/IRoxieServiceRef\"\n },\n {\n \"$ref\": \"#/definitions/IHipieSqlRef\"\n }\n ]\n },\n \"IDatasourceType\": {\n \"enum\": [\n \"wuresult\",\n \"logicalfile\",\n \"roxie\",\n \"hipie\",\n \"rest\",\n \"form\",\n \"databomb\"\n ],\n \"type\": \"string\"\n },\n \"IEquals\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"fieldID\": {\n \"type\": \"string\"\n },\n \"sourceFieldID\": {\n \"type\": \"string\"\n },\n \"transformations\": {\n \"items\": {\n \"$ref\": \"#/definitions/MultiTransformationType\"\n },\n \"type\": \"array\"\n },\n \"type\": {\n \"const\": \"=\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"fieldID\",\n \"type\",\n \"sourceFieldID\"\n ],\n \"type\": \"object\"\n },\n \"IField\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/IFieldBoolean\"\n },\n {\n \"$ref\": \"#/definitions/IFieldNumber\"\n },\n {\n \"$ref\": \"#/definitions/IFieldNumber64\"\n },\n {\n \"$ref\": \"#/definitions/IFieldString\"\n },\n {\n \"$ref\": \"#/definitions/IFieldRange\"\n },\n {\n \"$ref\": \"#/definitions/IFieldDataset\"\n },\n {\n \"$ref\": \"#/definitions/IFieldSet\"\n },\n {\n \"$ref\": \"#/definitions/IFieldObject\"\n }\n ]\n },\n \"IFieldBoolean\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"default\": {\n \"type\": \"boolean\"\n },\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"const\": \"boolean\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"type\": \"object\"\n },\n \"IFieldDataset\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"children\": {\n \"items\": {\n \"$ref\": \"#/definitions/IField\"\n },\n \"type\": \"array\"\n },\n \"default\": {\n \"$ref\": \"#/definitions/Dataset\"\n },\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"const\": \"dataset\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"children\"\n ],\n \"type\": \"object\"\n },\n \"IFieldNumber\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"default\": {\n \"type\": \"number\"\n },\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"const\": \"number\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"type\": \"object\"\n },\n \"IFieldNumber64\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"default\": {\n \"$ref\": \"#/definitions/Number64\"\n },\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"const\": \"number64\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"type\": \"object\"\n },\n \"IFieldObject\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"default\": {\n \"type\": \"object\"\n },\n \"fields\": {\n \"additionalProperties\": {\n \"$ref\": \"#/definitions/IField\"\n },\n \"type\": \"object\"\n },\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"const\": \"object\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"fields\"\n ],\n \"type\": \"object\"\n },\n \"IFieldRange\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"default\": {\n \"$ref\": \"#/definitions/Range\"\n },\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"const\": \"range\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"type\": \"object\"\n },\n \"IFieldSet\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"default\": {\n \"items\": {\n \"type\": [\n \"string\",\n \"number\"\n ]\n },\n \"type\": \"array\"\n },\n \"fieldType\": {\n \"enum\": [\n \"string\",\n \"number\"\n ],\n \"type\": \"string\"\n },\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"const\": \"set\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"fieldType\"\n ],\n \"type\": \"object\"\n },\n \"IFieldString\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"default\": {\n \"type\": \"string\"\n },\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"const\": \"string\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"type\": \"object\"\n },\n \"IFieldType\": {\n \"enum\": [\n \"boolean\",\n \"number\",\n \"number64\",\n \"string\",\n \"range\",\n \"dataset\",\n \"set\",\n \"object\"\n ],\n \"type\": \"string\"\n },\n \"IFilter\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"conditions\": {\n \"items\": {\n \"$ref\": \"#/definitions/FilterCondition\"\n },\n \"type\": \"array\"\n },\n \"type\": {\n \"const\": \"filter\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"conditions\",\n \"type\"\n ],\n \"type\": \"object\"\n },\n \"IFilterCondition\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"mappings\": {\n \"items\": {\n \"$ref\": \"#/definitions/IMapping\"\n },\n \"type\": \"array\"\n },\n \"viewID\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"viewID\",\n \"mappings\"\n ],\n \"type\": \"object\"\n },\n \"IFilterStaticCondition\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"condition\": {\n \"$ref\": \"#/definitions/IMappingConditionType\"\n },\n \"localFieldID\": {\n \"type\": \"string\"\n },\n \"value\": {\n \"type\": [\n \"string\",\n \"number\"\n ]\n }\n },\n \"required\": [\n \"localFieldID\",\n \"condition\",\n \"value\"\n ],\n \"type\": \"object\"\n },\n \"IForm\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"fields\": {\n \"items\": {\n \"$ref\": \"#/definitions/IField\"\n },\n \"type\": \"array\"\n },\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"const\": \"form\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"fields\",\n \"id\",\n \"type\"\n ],\n \"type\": \"object\"\n },\n \"IGroupBy\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"aggregates\": {\n \"items\": {\n \"$ref\": \"#/definitions/AggregateType\"\n },\n \"type\": \"array\"\n },\n \"groupByIDs\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\"\n },\n \"type\": {\n \"const\": \"groupby\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"aggregates\",\n \"groupByIDs\",\n \"type\"\n ],\n \"type\": \"object\"\n },\n \"IHipieService\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"inputs\": {\n \"items\": {\n \"$ref\": \"#/definitions/IField\"\n },\n \"type\": \"array\"\n },\n \"outputs\": {\n \"$ref\": \"#/definitions/OutputDict\"\n },\n \"queryID\": {\n \"type\": \"string\"\n },\n \"querySet\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"const\": \"hipie\",\n \"type\": \"string\"\n },\n \"url\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\",\n \"inputs\",\n \"outputs\",\n \"queryID\",\n \"querySet\",\n \"type\",\n \"url\"\n ],\n \"type\": \"object\"\n },\n \"IHipieSqlRef\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\"\n ],\n \"type\": \"object\"\n },\n \"ILimit\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"limit\": {\n \"type\": \"number\"\n },\n \"type\": {\n \"const\": \"limit\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"limit\",\n \"type\"\n ],\n \"type\": \"object\"\n },\n \"ILogicalFile\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"fields\": {\n \"items\": {\n \"$ref\": \"#/definitions/IField\"\n },\n \"type\": \"array\"\n },\n \"id\": {\n \"type\": \"string\"\n },\n \"logicalFile\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"const\": \"logicalfile\",\n \"type\": \"string\"\n },\n \"url\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"fields\",\n \"id\",\n \"logicalFile\",\n \"type\",\n \"url\"\n ],\n \"type\": \"object\"\n },\n \"IMap\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"default\": {},\n \"fieldID\": {\n \"type\": \"string\"\n },\n \"mappings\": {\n \"items\": {\n \"$ref\": \"#/definitions/IMapMapping\"\n },\n \"type\": \"array\"\n },\n \"sourceFieldID\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"const\": \"map\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"fieldID\",\n \"type\",\n \"sourceFieldID\",\n \"default\",\n \"mappings\"\n ],\n \"type\": \"object\"\n },\n \"IMapMapping\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"newValue\": {},\n \"value\": {}\n },\n \"required\": [\n \"value\",\n \"newValue\"\n ],\n \"type\": \"object\"\n },\n \"IMapping\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"condition\": {\n \"$ref\": \"#/definitions/IMappingConditionType\"\n },\n \"localFieldID\": {\n \"type\": \"string\"\n },\n \"nullable\": {\n \"type\": \"boolean\"\n },\n \"remoteFieldID\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"remoteFieldID\",\n \"localFieldID\",\n \"condition\",\n \"nullable\"\n ],\n \"type\": \"object\"\n },\n \"IMappingConditionType\": {\n \"enum\": [\n \"==\",\n \"!=\",\n \">\",\n \">=\",\n \"<\",\n \"<=\",\n \"range\",\n \"in\"\n ],\n \"type\": \"string\"\n },\n \"IMappings\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"transformations\": {\n \"items\": {\n \"$ref\": \"#/definitions/ProjectTransformationType\"\n },\n \"type\": \"array\"\n },\n \"type\": {\n \"const\": \"mappings\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"transformations\",\n \"type\"\n ],\n \"type\": \"object\"\n },\n \"IMulti\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"fieldID\": {\n \"type\": \"string\"\n },\n \"transformations\": {\n \"items\": {\n \"$ref\": \"#/definitions/MultiTransformationType\"\n },\n \"type\": \"array\"\n },\n \"type\": {\n \"const\": \"multi\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"fieldID\",\n \"type\",\n \"transformations\"\n ],\n \"type\": \"object\"\n },\n \"IOutput\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"fields\": {\n \"items\": {\n \"$ref\": \"#/definitions/IField\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"fields\"\n ],\n \"type\": \"object\"\n },\n \"IProject\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"transformations\": {\n \"items\": {\n \"$ref\": \"#/definitions/ProjectTransformationType\"\n },\n \"type\": \"array\"\n },\n \"type\": {\n \"const\": \"project\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"transformations\",\n \"type\"\n ],\n \"type\": \"object\"\n },\n \"IProperties\": {\n \"type\": \"object\"\n },\n \"IRequestField\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"localFieldID\": {\n \"type\": \"string\"\n },\n \"remoteFieldID\": {\n \"type\": \"string\"\n },\n \"source\": {\n \"type\": \"string\"\n },\n \"value\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"localFieldID\",\n \"source\",\n \"remoteFieldID\",\n \"value\"\n ],\n \"type\": \"object\"\n },\n \"IRestService\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"action\": {\n \"type\": \"string\"\n },\n \"id\": {\n \"type\": \"string\"\n },\n \"inputs\": {\n \"items\": {\n \"$ref\": \"#/definitions/IField\"\n },\n \"type\": \"array\"\n },\n \"mode\": {\n \"enum\": [\n \"get\",\n \"post\"\n ],\n \"type\": \"string\"\n },\n \"outputs\": {\n \"$ref\": \"#/definitions/OutputDict\"\n },\n \"type\": {\n \"const\": \"rest\",\n \"type\": \"string\"\n },\n \"url\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"action\",\n \"id\",\n \"inputs\",\n \"outputs\",\n \"type\",\n \"url\"\n ],\n \"type\": \"object\"\n },\n \"IRoxieService\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"inputs\": {\n \"items\": {\n \"$ref\": \"#/definitions/IField\"\n },\n \"type\": \"array\"\n },\n \"outputs\": {\n \"$ref\": \"#/definitions/OutputDict\"\n },\n \"queryID\": {\n \"type\": \"string\"\n },\n \"querySet\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"const\": \"roxie\",\n \"type\": \"string\"\n },\n \"url\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\",\n \"inputs\",\n \"outputs\",\n \"queryID\",\n \"querySet\",\n \"type\",\n \"url\"\n ],\n \"type\": \"object\"\n },\n \"IRoxieServiceRef\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"output\": {\n \"type\": \"string\"\n },\n \"request\": {\n \"items\": {\n \"$ref\": \"#/definitions/IRequestField\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"id\",\n \"output\",\n \"request\"\n ],\n \"type\": \"object\"\n },\n \"IScale\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"factor\": {\n \"type\": \"number\"\n },\n \"fieldID\": {\n \"type\": \"string\"\n },\n \"sourceFieldID\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"const\": \"scale\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"fieldID\",\n \"type\",\n \"sourceFieldID\",\n \"factor\"\n ],\n \"type\": \"object\"\n },\n \"ISort\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"conditions\": {\n \"items\": {\n \"$ref\": \"#/definitions/ISortCondition\"\n },\n \"type\": \"array\"\n },\n \"type\": {\n \"const\": \"sort\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"conditions\",\n \"type\"\n ],\n \"type\": \"object\"\n },\n \"ISortCondition\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"descending\": {\n \"type\": \"boolean\"\n },\n \"fieldID\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"fieldID\",\n \"descending\"\n ],\n \"type\": \"object\"\n },\n \"ITemplate\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"fieldID\": {\n \"type\": \"string\"\n },\n \"template\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"const\": \"template\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"fieldID\",\n \"type\",\n \"template\"\n ],\n \"type\": \"object\"\n },\n \"IView\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"activities\": {\n \"items\": {\n \"$ref\": \"#/definitions/ActivityType\"\n },\n \"type\": \"array\"\n },\n \"datasource\": {\n \"$ref\": \"#/definitions/IDatasourceRef\"\n },\n \"id\": {\n \"type\": \"string\"\n },\n \"visualization\": {\n \"$ref\": \"#/definitions/IVisualization\"\n }\n },\n \"required\": [\n \"id\",\n \"datasource\",\n \"activities\",\n \"visualization\"\n ],\n \"type\": \"object\"\n },\n \"IVisualization\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"__class\": {\n \"type\": \"string\"\n },\n \"chartType\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"id\": {\n \"type\": \"string\"\n },\n \"mappings\": {\n \"$ref\": \"#/definitions/IMappings\"\n },\n \"properties\": {\n \"$ref\": \"#/definitions/IWidgetProperties\"\n },\n \"secondaryDataviewID\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"visibility\": {\n \"$ref\": \"#/definitions/VisibilityType\"\n }\n },\n \"required\": [\n \"__class\",\n \"chartType\",\n \"id\",\n \"mappings\",\n \"properties\",\n \"title\",\n \"visibility\"\n ],\n \"type\": \"object\"\n },\n \"IWUResult\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"outputs\": {\n \"$ref\": \"#/definitions/OutputDict\"\n },\n \"type\": {\n \"const\": \"wuresult\",\n \"type\": \"string\"\n },\n \"url\": {\n \"type\": \"string\"\n },\n \"wuid\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\",\n \"outputs\",\n \"type\",\n \"url\",\n \"wuid\"\n ],\n \"type\": \"object\"\n },\n \"IWUResultRef\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"output\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\",\n \"output\"\n ],\n \"type\": \"object\"\n },\n \"IWidgetProperties\": {\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\"\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"not\": {}\n },\n {\n \"$ref\": \"#/definitions/IWidgetProperties\"\n },\n {\n \"items\": {\n \"$ref\": \"#/definitions/IWidgetProperties\"\n },\n \"type\": \"array\"\n }\n ]\n },\n \"properties\": {\n \"__class\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"__class\"\n ],\n \"type\": \"object\"\n },\n \"MultiTransformationType\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/IEquals\"\n },\n {\n \"$ref\": \"#/definitions/ICalculated\"\n },\n {\n \"$ref\": \"#/definitions/IScale\"\n },\n {\n \"$ref\": \"#/definitions/ITemplate\"\n },\n {\n \"$ref\": \"#/definitions/IMap\"\n }\n ]\n },\n \"Number64\": {\n \"type\": \"string\"\n },\n \"OutputDict\": {\n \"additionalProperties\": {\n \"$ref\": \"#/definitions/IOutput\"\n },\n \"type\": \"object\"\n },\n \"ProjectTransformationType\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/MultiTransformationType\"\n },\n {\n \"$ref\": \"#/definitions/IMulti\"\n }\n ]\n },\n \"Range\": {\n \"items\": {\n \"type\": [\n \"number\",\n \"string\"\n ]\n },\n \"maxItems\": 2,\n \"minItems\": 2,\n \"type\": \"array\"\n },\n \"Schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"createdBy\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"version\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"name\",\n \"version\"\n ],\n \"type\": \"object\"\n },\n \"datasources\": {\n \"items\": {\n \"$ref\": \"#/definitions/DatasourceType\"\n },\n \"type\": \"array\"\n },\n \"dataviews\": {\n \"items\": {\n \"$ref\": \"#/definitions/IView\"\n },\n \"type\": \"array\"\n },\n \"defs\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"activityTypes\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"filter\": {\n \"$ref\": \"#/definitions/IFilter\"\n },\n \"groupby\": {\n \"$ref\": \"#/definitions/IGroupBy\"\n },\n \"limit\": {\n \"$ref\": \"#/definitions/ILimit\"\n },\n \"mappings\": {\n \"$ref\": \"#/definitions/IMappings\"\n },\n \"project\": {\n \"$ref\": \"#/definitions/IProject\"\n },\n \"sort\": {\n \"$ref\": \"#/definitions/ISort\"\n }\n },\n \"required\": [\n \"filter\",\n \"project\",\n \"groupby\",\n \"sort\",\n \"limit\",\n \"mappings\"\n ],\n \"type\": \"object\"\n },\n \"aggregateTypes\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"aggregate\": {\n \"$ref\": \"#/definitions/IAggregate\"\n },\n \"count\": {\n \"$ref\": \"#/definitions/ICount\"\n }\n },\n \"required\": [\n \"aggregate\",\n \"count\"\n ],\n \"type\": \"object\"\n },\n \"datasourceRefTypes\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"roxieServiceRef\": {\n \"$ref\": \"#/definitions/IRoxieServiceRef\"\n },\n \"wuResultRef\": {\n \"$ref\": \"#/definitions/IWUResultRef\"\n }\n },\n \"required\": [\n \"wuResultRef\",\n \"roxieServiceRef\"\n ],\n \"type\": \"object\"\n },\n \"datasourceTypes\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"databomb\": {\n \"$ref\": \"#/definitions/IDatabomb\"\n },\n \"datasource\": {\n \"$ref\": \"#/definitions/IDatasource\"\n },\n \"form\": {\n \"$ref\": \"#/definitions/IForm\"\n },\n \"hipieService\": {\n \"$ref\": \"#/definitions/IHipieService\"\n },\n \"logicalFile\": {\n \"$ref\": \"#/definitions/ILogicalFile\"\n },\n \"roxieService\": {\n \"$ref\": \"#/definitions/IRoxieService\"\n },\n \"wuresult\": {\n \"$ref\": \"#/definitions/IWUResult\"\n }\n },\n \"required\": [\n \"datasource\",\n \"logicalFile\",\n \"form\",\n \"databomb\",\n \"wuresult\",\n \"hipieService\",\n \"roxieService\"\n ],\n \"type\": \"object\"\n },\n \"fieldTypes\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"dataset\": {\n \"$ref\": \"#/definitions/Dataset\"\n },\n \"field\": {\n \"$ref\": \"#/definitions/IField\"\n },\n \"fieldBoolean\": {\n \"$ref\": \"#/definitions/IFieldBoolean\"\n },\n \"fieldDataset\": {\n \"$ref\": \"#/definitions/IFieldDataset\"\n },\n \"fieldNumber\": {\n \"$ref\": \"#/definitions/IFieldNumber\"\n },\n \"fieldNumber64\": {\n \"$ref\": \"#/definitions/IFieldNumber64\"\n },\n \"fieldObject\": {\n \"$ref\": \"#/definitions/IFieldObject\"\n },\n \"fieldRange\": {\n \"$ref\": \"#/definitions/IFieldRange\"\n },\n \"fieldSet\": {\n \"$ref\": \"#/definitions/IFieldSet\"\n },\n \"fieldString\": {\n \"$ref\": \"#/definitions/IFieldString\"\n },\n \"fieldType\": {\n \"$ref\": \"#/definitions/IFieldType\"\n },\n \"number64\": {\n \"$ref\": \"#/definitions/Number64\"\n },\n \"range\": {\n \"$ref\": \"#/definitions/Range\"\n }\n },\n \"required\": [\n \"number64\",\n \"range\",\n \"dataset\",\n \"fieldType\",\n \"fieldBoolean\",\n \"fieldNumber\",\n \"fieldNumber64\",\n \"fieldString\",\n \"fieldRange\",\n \"fieldDataset\",\n \"fieldSet\",\n \"fieldObject\",\n \"field\"\n ],\n \"type\": \"object\"\n },\n \"transformationTypes\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"calculated\": {\n \"$ref\": \"#/definitions/ICalculated\"\n },\n \"equals\": {\n \"$ref\": \"#/definitions/IEquals\"\n },\n \"map\": {\n \"$ref\": \"#/definitions/IMap\"\n },\n \"multi\": {\n \"$ref\": \"#/definitions/IMulti\"\n },\n \"scale\": {\n \"$ref\": \"#/definitions/IScale\"\n },\n \"template\": {\n \"$ref\": \"#/definitions/ITemplate\"\n }\n },\n \"required\": [\n \"equals\",\n \"calculated\",\n \"scale\",\n \"template\",\n \"map\",\n \"multi\"\n ],\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"fieldTypes\",\n \"datasourceTypes\",\n \"datasourceRefTypes\",\n \"activityTypes\",\n \"aggregateTypes\",\n \"transformationTypes\"\n ],\n \"type\": \"object\"\n },\n \"hipieProperties\": {\n \"$ref\": \"#/definitions/IProperties\"\n },\n \"properties\": {\n \"$ref\": \"#/definitions/IProperties\"\n },\n \"version\": {\n \"const\": \"2.2.1\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"version\",\n \"createdBy\",\n \"datasources\",\n \"dataviews\"\n ],\n \"type\": \"object\"\n },\n \"VisibilityType\": {\n \"enum\": [\n \"normal\",\n \"flyout\"\n ],\n \"type\": \"string\"\n }\n }\n}\n","import * as _Ajv from \"ajv\";\nimport * as DDL from \"./ddl/v1.ts\";\nimport * as DDL2 from \"./ddl/v2.ts\";\n\nconst Ajv = (_Ajv as any).default || _Ajv;\n\nexport const ddl2Schema: object = _ddl2Schema;\n\nconst options: _Ajv.Options = {\n allErrors: false,\n verbose: true,\n jsonPointers: false\n};\n\nfunction doValidate(ddl: DDL.DDLSchema | DDL2.Schema, schema: DDL.DDLSchema | DDL2.Schema) {\n const ajv: _Ajv.Ajv = new Ajv(options);\n const validate = ajv.compile(schema);\n const success = validate(ddl);\n return {\n success,\n errors: validate.errors\n };\n}\n\n/* Not needed ---\n// @ts-ignore\nimport * as ddlSchema from \"../schema/v1.json\";\n\nexport function validate(ddl: DDL.DDLSchema) {\n return doValidate(ddl, ddlSchema);\n}\n*/\n\nimport _ddl2Schema from \"../schema/v2.json\" with { type: \"json\" };\n\nexport function validate2(ddl: DDL2.Schema) {\n return doValidate(ddl, _ddl2Schema as any);\n}\n","export * from \"./__package__.ts\";\nimport * as DDL1 from \"./ddl/v1.ts\";\nimport * as DDL2 from \"./ddl/v2.ts\";\nexport * from \"./upgrade.ts\";\nexport * from \"./validate.ts\";\n\nexport { DDL1, DDL2 };\n\nexport function isDDL2Schema(ref: DDL1.DDLSchema | DDL2.Schema): ref is DDL2.Schema {\n return (ref as DDL2.Schema).version !== undefined && (ref as DDL2.Schema).datasources !== undefined && (ref as DDL2.Schema).dataviews !== undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,MAAa,WAAW;AACxB,MAAa,cAAc;AAC3B,MAAa,gBAAgB;;;;;;;;;;;;;;;;;;;;AC0B7B,SAAgB,qBAAqB,KAAiD;AAClF,QAAQ,IAA4B,SAAS;;AAMjD,SAAgB,q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S,WAAW,KAAkC,QAAqC;CAEvF,MAAM,WADgB,IAAI,IAAI,QAAQ,CACjB,QAAQ,OAAO;AAEpC,QAAO;EACH,SAFY,SAAS,IAAI;EAGzB,QAAQ,SAAS;EACpB;;AAcL,SAAgB,UAAU,KAAkB;AACxC,QAAO,WAAW,KAAK,WAAmB;;;;;AC5B9C,SAAgB,aAAa,KAAuD;AAChF,QAAQ,IAAoB,YAAY,UAAc,IAAoB,gBAAgB,UAAc,IAAoB,cAAc"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/__package__.ts","../src/ddl/v1.ts","../src/ddl/v2.ts","../src/dermatology.ts","../src/upgrade.ts","../src/validate.ts","../src/index.ts"],"sourcesContent":["export const PKG_NAME = \"__PACKAGE_NAME__\";\nexport const PKG_VERSION = \"__PACKAGE_VERSION__\";\nexport const BUILD_VERSION = \"__BUILD_VERSION__\";\n","export type StringStringDict = { [key: string]: string; };\n\n// Datasource ===============================================================\nexport type IFilterRule = \"==\" | \"!=\" | \"<\" | \"<=\" | \">\" | \">=\" | \"set\" | \"notequals\";\nexport interface IFilter {\n fieldid: string;\n nullable: boolean;\n rule: IFilterRule;\n minid?: string;\n maxid?: string;\n}\n\nexport interface IOutput {\n id: string;\n from?: string;\n filter?: IFilter[];\n notify?: string[];\n}\n\nexport interface IDatasource {\n id: string;\n filter?: IFilter[];\n outputs: IOutput[];\n}\n\nexport interface IWorkunitDatasource extends IDatasource {\n WUID: boolean;\n}\nexport function isWorkunitDatasource(ref: IAnyDatasource): ref is IWorkunitDatasource {\n return (ref as IWorkunitDatasource).WUID !== undefined;\n}\n\nexport interface IDatabombDatasource extends IDatasource {\n databomb: true;\n}\nexport function isDatabombDatasource(ref: IAnyDatasource): ref is IDatabombDatasource {\n return (ref as IDatabombDatasource).databomb === true;\n}\n\nexport interface IHipieDatasource extends IDatasource {\n URL: string;\n}\nexport function isHipieDatasource(ref: IAnyDatasource): ref is IHipieDatasource {\n return (ref as IHipieDatasource).URL !== undefined;\n}\n\nexport type IAnyDatasource = IWorkunitDatasource | IDatabombDatasource | IHipieDatasource;\n// Event ====================================================================\nexport interface IEventUpdate {\n visualization: string;\n instance?: string;\n datasource: string;\n col?: string;\n merge: boolean;\n mappings?: StringStringDict;\n}\n\nexport interface IEvent {\n mappings?: StringStringDict; // Legacy\n updates: IEventUpdate[];\n}\n\n// Mappings =================================================================\nexport interface IPieMapping {\n label: string;\n weight: string;\n}\n\nexport interface ILineMapping {\n x: string[];\n y: string[];\n}\n\nexport interface ITableMapping {\n value: string[];\n}\n\nexport interface IChoroMapping {\n weight: string | string[];\n}\n\nexport interface IChoroUSStateMapping extends IChoroMapping {\n state: string;\n}\n\nexport interface IChoroUSCountyMapping extends IChoroMapping {\n county: string;\n}\n\nexport interface IChoroGeohashMapping extends IChoroMapping {\n geohash: string;\n}\n\nexport interface IGraphMapping {\n uid: string;\n label: string;\n weight: string;\n flags: string;\n}\n\nexport interface IGraphLinkMapping {\n uid: string;\n}\n\nexport interface IHeatMapMapping {\n x: string;\n y: string;\n weight: string;\n}\n\nexport interface ISliderMapping {\n label: string;\n}\n// Source ===================================================================\nexport interface ISource {\n id: string;\n output: string;\n sort?: string[];\n first?: string | number;\n reverse?: boolean;\n properties?: StringStringDict; // TODO Needed?\n}\n\nexport interface IPieSource extends ISource {\n mappings: IPieMapping;\n}\n\nexport interface ILineSource extends ISource {\n mappings: ILineMapping;\n}\n\nexport interface ITableSource extends ISource {\n mappings: ITableMapping;\n}\n\nexport interface IGraphLink {\n mappings: IGraphLinkMapping;\n childfile: string;\n}\n\nexport interface IGraphSource extends ISource {\n mappings: IGraphMapping;\n link: IGraphLink;\n}\n\nexport interface IHeatMapSource extends ISource {\n mappings: IHeatMapMapping;\n}\n\nexport interface IChoroSource extends ISource {\n mappings: IAnyChoroMapping;\n}\n\nexport interface ISliderSource extends ISource {\n mappings: ISliderMapping;\n}\n\n// Visualization ============================================================\nexport type VisualizationType = \"PIE\" | \"LINE\" | \"BAR\" | \"TABLE\" | \"CHORO\" | \"GRAPH\" | \"HEAT_MAP\" | \"SLIDER\" | \"SUMMARY\" | \"FORM\" | \"2DCHART\" | \"WORD_CLOUD\" | \"BUBBLE\";\nexport type VisualizationFieldDataType = \"bool\" | \"boolean\" | \"integer\" | \"integer4\" | \"integer8\" | \"unsigned\" | \"unsigned4\" | \"unsigned8\" | \"float\" | \"double\" | \"real\" | \"real4\" | \"real8\" | \"string\" | \"date\" | \"time\" | \"geohash\" | \"dataset\" | \"visualization\";\nexport type VisualizationFieldType = VisualizationFieldDataType | \"range\";\nexport type VisualizationFieldFuncitonType = \"SUM\" | \"AVE\" | \"MIN\" | \"MAX\" | \"SCALE\";\n\nexport interface IVisualizationField {\n id: string;\n properties: {\n label?: string;\n datatype: VisualizationFieldDataType;\n default?: any[];\n function?: VisualizationFieldFuncitonType;\n params?: {\n param1: string;\n param2: string;\n }\n type: VisualizationFieldType;\n };\n}\n\nexport interface IVisualization {\n id: string;\n title?: string;\n type: VisualizationType;\n fields?: IVisualizationField[];\n properties?: {\n charttype?: string,\n\n // TODO Split Known Properties ---\n [key: string]: any\n };\n events?: { [key: string]: IEvent };\n onSelect?: any; // legacy\n color?: any; // legacy\n}\n\nexport interface IPieVisualization extends IVisualization {\n type: \"PIE\" | \"BAR\";\n source: IPieSource;\n}\nexport function isPieVisualization(viz: IAnyVisualization): viz is IPieVisualization {\n return (viz as IPieVisualization).type === \"PIE\" || (viz as IPieVisualization).type === \"BAR\";\n}\n\nexport interface ILineVisualization extends IVisualization {\n type: \"LINE\";\n source: ILineSource;\n}\nexport function isLineVisualization(viz: IAnyVisualization): viz is ILineVisualization {\n return (viz as ILineVisualization).type === \"LINE\";\n}\n\nexport type ChoroColor = \"default\" | \"YlGn\" | \"YlGnBu\" | \"GnBu\" | \"BuGn\" | \"PuBuGn\" | \"PuBu\" | \"BuPu\" | \"RdPu\" | \"PuRd\" | \"OrRd\" | \"YlOrRd\" | \"YlOrBr\" | \"Purples\" | \"Blues\" | \"Greens\" | \"Oranges\" | \"Reds\" | \"Greys\" | \"PuOr\" | \"BrBG\" | \"PRGn\" | \"PiYG\" | \"RdBu\" | \"RdGy\" | \"RdYlBu\" | \"Spectral\" | \"RdYlGn\" | \"RdWhGr\";\nexport interface IChoroVisualization extends IVisualization {\n type: \"CHORO\";\n source: IChoroSource;\n\n visualizations?: IChoroVisualization[];\n color?: ChoroColor;\n}\nexport function isChoroVisualization(viz: IAnyVisualization): viz is IChoroVisualization {\n return (viz as IChoroVisualization).type === \"CHORO\";\n}\n\nexport interface ITableVisualization extends IVisualization {\n type: \"TABLE\";\n label: string[];\n source: ITableSource;\n}\nexport function isTableVisualization(viz: IAnyVisualization): viz is ITableVisualization {\n return (viz as ITableVisualization).type === \"TABLE\";\n}\n\nexport interface ISliderVisualization extends IVisualization {\n type: \"SLIDER\";\n source: ISliderSource;\n range?: number[];\n}\nexport function isSliderVisualization(viz: IAnyVisualization): viz is ISliderVisualization {\n return (viz as ISliderVisualization).type === \"SLIDER\";\n}\n\nexport interface IIcon {\n [id: string]: string | number | boolean;\n}\n\nexport type IValueMappings = { [key: string]: IIcon; };\n\nexport interface IVisualizationIcon {\n fieldid?: string;\n faChar?: string;\n valuemappings?: IValueMappings;\n}\n\nexport interface IGraphVisualization extends IVisualization {\n type: \"GRAPH\";\n source: IGraphSource;\n\n label: string[];\n icon: IVisualizationIcon;\n flag: IVisualizationIcon[];\n}\nexport function isGraphVisualization(viz: IAnyVisualization): viz is IGraphVisualization {\n return (viz as IGraphVisualization).type === \"GRAPH\";\n}\n\nexport interface IHeatMapVisualization extends IVisualization {\n type: \"HEAT_MAP\";\n source: IHeatMapSource;\n}\nexport function isHeatMapVisualization(viz: IAnyVisualization): viz is IHeatMapVisualization {\n return (viz as IHeatMapVisualization).type === \"HEAT_MAP\";\n}\n\nexport interface IFormVisualization extends IVisualization {\n type: \"FORM\";\n}\nexport function isFormVisualization(viz: IAnyVisualization): viz is IFormVisualization {\n return (viz as IFormVisualization).type === \"FORM\";\n}\n\n// Dashboard ================================================================\nexport interface IDashboard {\n id?: string;\n title?: string;\n enable?: string;\n label?: string;\n primary?: boolean;\n visualizations: IAnyVisualization[];\n}\n\nexport interface IDDL {\n dashboards: IDashboard[];\n datasources: IAnyDatasource[];\n hipieversion: string;\n visualizationversion: string;\n}\n\n// DDL ======================================================================\nexport type DDLSchema = IDDL;\n\n// Helpers ==================================================================\nexport type IAnyChoroMapping = IChoroUSStateMapping | IChoroUSCountyMapping | IChoroGeohashMapping;\nexport function isUSStateMapping(mappings: IAnyChoroMapping) {\n return (mappings as IChoroUSStateMapping).state !== undefined;\n}\nexport function isUSCountyMapping(mappings: IAnyChoroMapping) {\n return (mappings as IChoroUSCountyMapping).county !== undefined;\n}\nexport function isGeohashMapping(mappings: IAnyChoroMapping) {\n return (mappings as IChoroGeohashMapping).geohash !== undefined;\n}\nexport type IAnyMapping = IPieMapping | ILineMapping | IGraphMapping | IAnyChoroMapping | ITableMapping | IHeatMapMapping;\nexport type IAnySource = IPieSource | ILineSource | ITableSource | IChoroSource | IGraphSource | IHeatMapSource;\nexport type IAnyVisualization = IPieVisualization | ILineVisualization | ITableVisualization | IChoroVisualization | IGraphVisualization | IHeatMapVisualization | ISliderVisualization | IFormVisualization;\n","export type RowType = { [key: string]: any; };\n\n// Fields ==============================================================\nexport type Number64 = string;\nexport type Range = [number | string, number | string];\nexport type Dataset = any[];\nexport type IFieldType = \"boolean\" | \"number\" | \"number64\" | \"string\" | \"range\" | \"dataset\" | \"set\" | \"object\";\n\nexport interface IFieldBoolean {\n type: \"boolean\";\n id: string;\n default?: boolean;\n}\n\nexport interface IFieldNumber {\n type: \"number\";\n id: string;\n default?: number;\n}\n\nexport interface IFieldNumber64 {\n type: \"number64\";\n id: string;\n default?: Number64;\n}\n\nexport interface IFieldString {\n type: \"string\";\n id: string;\n default?: string;\n}\n\nexport interface IFieldRange {\n type: \"range\";\n id: string;\n default?: Range;\n}\n\nexport interface IFieldDataset {\n type: \"dataset\";\n id: string;\n default?: Dataset;\n children: IField[];\n}\n\nexport interface IFieldSet {\n type: \"set\";\n id: string;\n default?: Array<string | number>;\n fieldType: \"string\" | \"number\";\n}\n\nexport interface IFieldObject {\n type: \"object\";\n id: string;\n default?: object;\n fields: { [key: string]: IField };\n}\n\nexport type IField = IFieldBoolean | IFieldNumber | IFieldNumber64 | IFieldString | IFieldRange | IFieldDataset | IFieldSet | IFieldObject;\n\n// Datasources ==============================================================\nexport type IDatasourceType = \"wuresult\" | \"logicalfile\" | \"roxie\" | \"hipie\" | \"rest\" | \"form\" | \"databomb\";\nexport type DatasourceType = IWUResult | ILogicalFile | IRoxieService | IHipieService | IRestService | IForm | IDatabomb;\n\nexport interface IDatasource {\n type: IDatasourceType;\n id: string;\n}\n\nexport interface IService extends IDatasource {\n url: string;\n}\n\nexport interface IOutput {\n fields: IField[];\n}\n\nexport type OutputDict = { [key: string]: IOutput };\n\nexport interface IWUResult extends IService {\n type: \"wuresult\";\n wuid: string;\n outputs: OutputDict;\n}\n\nexport interface ILogicalFile extends IService {\n type: \"logicalfile\";\n logicalFile: string;\n fields: IField[];\n}\n\nexport interface IRoxieService extends IService {\n type: \"roxie\";\n querySet: string;\n queryID: string;\n inputs: IField[];\n outputs: OutputDict;\n}\n\nexport interface IHipieService extends IService {\n type: \"hipie\";\n querySet: string;\n queryID: string;\n inputs: IField[];\n outputs: OutputDict;\n}\n\nexport interface IRestService extends IService {\n type: \"rest\";\n action: string;\n mode?: \"get\" | \"post\";\n inputs: IField[];\n outputs: OutputDict;\n}\n\nexport interface IForm extends IDatasource {\n type: \"form\";\n fields: IField[];\n}\n\nexport type IDatabombFormat = \"csv\" | \"tsv\" | \"json\";\nexport interface IDatabomb extends IDatasource {\n type: \"databomb\";\n fields: IField[];\n format: IDatabombFormat;\n payload?: string;\n}\n\n// IDatasorceRef ---\nexport interface IDatasourceBaseRef {\n id: string;\n}\n\nexport interface IDatabombRef extends IDatasourceBaseRef {\n}\n\nexport interface IWUResultRef extends IDatasourceBaseRef {\n output: string;\n}\n\nexport interface IRestResultRef extends IDatasourceBaseRef {\n responseField: string;\n}\n\nexport interface IHipieSqlRef extends IDatasourceBaseRef {\n}\n\nexport interface IRequestField {\n localFieldID: string;\n source: string;\n remoteFieldID: string;\n value: string;\n}\n\nexport interface IRoxieServiceRef extends IDatasourceBaseRef {\n request: IRequestField[];\n output: string;\n}\n\nexport type IDatasourceRef = IDatabombRef | IWUResultRef | IRoxieServiceRef | IHipieSqlRef;\n\nexport function isDatabombRef(ref: IDatasourceRef): ref is IDatabombRef {\n return !isWUResultRef(ref) && !isRoxieServiceRef(ref);\n}\n\nexport function isWUResultRef(ref: IDatasourceRef): ref is IWUResultRef {\n return (ref as IWUResultRef).output !== undefined && !isRoxieServiceRef(ref);\n}\n\nexport function isRoxieServiceRef(ref: IDatasourceRef): ref is IRoxieServiceRef {\n return (ref as IRoxieServiceRef).request !== undefined;\n}\n\n// Activities ===============================================================\nexport type IActivityType = \"filter\" | \"project\" | \"groupby\" | \"sort\" | \"limit\" | \"mappings\";\nexport type ActivityType = IFilter | IProject | IGroupBy | ISort | ILimit | IMappings;\n\nexport interface IActivity {\n type: IActivityType;\n}\n\n// Filter ===================================================================\nexport type IMappingConditionType = \"==\" | \"!=\" | \">\" | \">=\" | \"<\" | \"<=\" | \"range\" | \"in\";\nexport interface IMapping {\n remoteFieldID: string;\n localFieldID: string;\n condition: IMappingConditionType;\n nullable: boolean;\n}\n\nexport interface IFilterCondition {\n viewID: string;\n mappings: IMapping[];\n}\n\nexport interface IFilterStaticCondition {\n localFieldID: string;\n condition: IMappingConditionType;\n value: string | number;\n}\n\nexport type FilterCondition = IFilterCondition | IFilterStaticCondition;\nexport function isIFilterCondition(fc: FilterCondition): fc is IFilterCondition {\n return !!(fc as IFilterCondition).viewID;\n}\n\nexport interface IFilter extends IActivity {\n type: \"filter\";\n conditions: FilterCondition[];\n}\nexport function isFilterActivity(activity: IActivity): activity is IFilter {\n return activity.type === \"filter\";\n}\n\n// Project ==================================================================\nexport interface IEquals {\n fieldID: string;\n type: \"=\";\n sourceFieldID: string;\n transformations?: MultiTransformationType[];\n}\nexport type ICalculatedType = \"+\" | \"-\" | \"*\" | \"/\";\nexport interface ICalculated {\n fieldID: string;\n type: ICalculatedType;\n sourceFieldID1: string;\n sourceFieldID2: string;\n}\n\nexport interface IScale {\n fieldID: string;\n type: \"scale\";\n sourceFieldID: string;\n factor: number;\n}\n\nexport interface ITemplate {\n fieldID: string;\n type: \"template\";\n template: string;\n}\n\nexport interface IMapMapping {\n value: any;\n newValue: any;\n}\n\nexport interface IMap {\n fieldID: string;\n type: \"map\";\n sourceFieldID: string;\n default: any;\n mappings: IMapMapping[];\n}\n\nexport type MultiTransformationType = IEquals | ICalculated | IScale | ITemplate | IMap;\nexport interface IMulti {\n fieldID: string;\n type: \"multi\";\n transformations: MultiTransformationType[];\n}\n\nexport type ProjectTransformationType = MultiTransformationType | IMulti;\nexport interface IProject extends IActivity {\n type: \"project\";\n transformations: ProjectTransformationType[];\n}\nexport function isProjectActivity(activity: IActivity): activity is IProject {\n return activity.type === \"project\";\n}\nexport interface IMappings extends IActivity {\n type: \"mappings\";\n transformations: ProjectTransformationType[];\n}\nexport function isMappingsActivity(activity: IActivity): activity is IMappings {\n return activity.type === \"mappings\";\n}\n// GroupBy ==================================================================\nexport type IAggregateType = \"min\" | \"max\" | \"sum\" | \"mean\" | \"variance\" | \"deviation\";\nexport interface IAggregate {\n fieldID: string;\n type: IAggregateType;\n inFieldID: string;\n baseCountFieldID?: string;\n}\n\nexport interface ICount {\n fieldID: string;\n type: \"count\";\n}\n\nexport type AggregateType = IAggregate | ICount;\n\nexport interface IGroupBy extends IActivity {\n type: \"groupby\";\n groupByIDs: string[];\n aggregates: AggregateType[];\n}\nexport function isGroupByActivity(activity: IActivity): activity is IGroupBy {\n return activity.type === \"groupby\";\n}\n\n// Sort =====================================================================\nexport interface ISortCondition {\n fieldID: string;\n descending: boolean;\n}\n\nexport interface ISort extends IActivity {\n type: \"sort\";\n conditions: ISortCondition[];\n}\nexport function isSortActivity(activity: IActivity): activity is ISort {\n return activity.type === \"sort\";\n}\n\n// Limit ====================================================================\nexport interface ILimit extends IActivity {\n type: \"limit\";\n limit: number;\n}\nexport function isLimitActivity(activity: IActivity): activity is ILimit {\n return activity.type === \"limit\";\n}\n\n// Visualization ============================================================\nexport interface IWidgetProperties {\n __class: string;\n [propID: string]: string | string[] | number | boolean | undefined | IWidgetProperties | IWidgetProperties[];\n}\n\nexport interface IWidget {\n id: string;\n chartType: string;\n __class: string;\n properties: IWidgetProperties;\n}\n\nexport type VisibilityType = \"normal\" | \"flyout\";\nexport const VisibilitySet: VisibilityType[] = [\"normal\", \"flyout\"];\n\nexport interface IVisualization extends IWidget {\n title: string;\n description?: string;\n visibility: VisibilityType;\n mappings: IMappings;\n secondaryDataviewID?: string;\n}\n\n// View =====================================================================\nexport interface IView {\n id: string;\n datasource: IDatasourceRef;\n activities: ActivityType[];\n visualization: IVisualization;\n}\n\n// DDL ======================================================================\nexport interface IProperties {\n [propID: string]: any;\n}\n\nexport interface Schema {\n version: \"2.2.1\";\n createdBy: {\n name: string;\n version: string;\n };\n datasources: DatasourceType[];\n dataviews: IView[];\n properties?: IProperties;\n hipieProperties?: IProperties;\n\n // The following defs are only provided to assist the Java code generation (from the the generated schema) ---\n defs?: {\n fieldTypes: {\n number64: Number64;\n range: Range;\n dataset: Dataset;\n fieldType: IFieldType;\n fieldBoolean: IFieldBoolean;\n fieldNumber: IFieldNumber;\n fieldNumber64: IFieldNumber64\n fieldString: IFieldString;\n fieldRange: IFieldRange;\n fieldDataset: IFieldDataset;\n fieldSet: IFieldSet;\n fieldObject: IFieldObject;\n field: IField;\n };\n datasourceTypes: {\n datasource: IDatasource;\n logicalFile: ILogicalFile;\n form: IForm;\n databomb: IDatabomb;\n wuresult: IWUResult;\n hipieService: IHipieService;\n roxieService: IRoxieService;\n };\n datasourceRefTypes: {\n wuResultRef: IWUResultRef;\n roxieServiceRef: IRoxieServiceRef;\n };\n activityTypes: {\n filter: IFilter;\n project: IProject;\n groupby: IGroupBy;\n sort: ISort;\n limit: ILimit;\n mappings: IMappings;\n };\n aggregateTypes: {\n aggregate: IAggregate;\n count: ICount;\n };\n transformationTypes: {\n equals: IEquals;\n calculated: ICalculated;\n scale: IScale;\n template: ITemplate;\n map: IMap;\n multi: IMulti;\n };\n };\n}\n","import * as DDL2 from \"./ddl/v2.ts\";\n\nconst classMappings: any = {\n c3chart_Bar: \"chart_Bar\",\n c3chart_Column: \"chart_Column\",\n c3chart_Pie: \"chart_Pie\",\n c3chart_Area: \"chart_Area\",\n c3chart_Line: \"chart_Line\",\n amchart_Bar: \"chart_Bar\",\n amchart_Column: \"chart_Column\",\n amchart_Pie: \"chart_Pie\",\n amchart_Area: \"chart_Area\",\n amchart_Line: \"chart_Line\",\n google_Bar: \"chart_Bar\",\n google_Column: \"chart_Column\",\n google_Pie: \"chart_Pie\",\n google_Area: \"chart_Area\",\n google_Line: \"chart_Line\",\n other_Table: \"dgrid_Table\"\n};\nconst propertyMappings: any = {\n xAxisLabelRotation: [\n { name: \"xAxisOverlapMode\", transform: (n: any) => \"rotate\" },\n { name: \"xAxisLabelRotation\", transform: (n: any) => n }\n ],\n tooltipLabelColor: {\n name: \"tooltipLabelColor\"\n },\n tooltipSeriesColor: {\n name: \"tooltipSeriesColor\"\n },\n tooltipValueColor: {\n name: \"tooltipValueColor\"\n },\n tooltipValueFormat: {\n name: \"tooltipValueFormat\"\n },\n timePattern: {\n name: \"xAxisTypeTimePattern\"\n },\n smoothLines: {\n name: \"interpolate\",\n transform: (n: any) => {\n if (n === false) return \"linear\";\n return \"catmullRom\";\n }\n },\n holePercent: {\n name: \"innerRadius\"\n },\n flip: {\n name: \"orientation\",\n transform: (n: any) => n ? \"vertical\" : \"horizontal\"\n },\n bottomText: {\n name: \"xAxisTitle\"\n },\n xAxisTypeTimePattern: {\n name: \"xAxisTypeTimePattern\"\n },\n yAxisTypeTimePattern: {\n name: \"yAxisTypeTimePattern\"\n },\n valueFormat: {\n name: \"tooltipValueFormat\"\n },\n stacked: {\n name: \"yAxisStacked\"\n },\n showYGrid: {\n name: \"yAxisGuideLines\"\n },\n showXGrid: {\n name: \"xAxisGuideLines\"\n },\n showValueLabel: {\n name: \"showValue\"\n },\n low: {\n name: \"yAxisDomainLow\"\n },\n high: {\n name: \"yAxisDomainHigh\"\n },\n fillOpacity: {\n name: \"interpolateFillOpacity\"\n },\n areaFillOpacity: {\n name: \"interpolateFillOpacity\"\n },\n showToolbar: {\n name: \"titleVisible\"\n },\n showCSV: {\n name: \"downloadButtonVisible\"\n }\n};\n\nfunction findKeyVal(object: any, key: any, val: any): any {\n let value;\n\n for (const k in object) {\n if (k === key && object[k] === val) {\n value = object;\n break;\n }\n if (object[k] && typeof object[k] === \"object\") {\n value = findKeyVal(object[k], key, val);\n if (value !== undefined) {\n break;\n }\n }\n }\n return value;\n}\n\nfunction apply_to_dataviews(ddl2: DDL2.Schema, dermObj: any) {\n\n ddl2.dataviews.forEach(apply_to_dataview);\n\n function apply_to_dataview(dv: any) {\n const widgetId = dv.id;\n const dermPanelObj: any = findKeyVal(dermObj, \"__id\", widgetId);\n if (dermPanelObj) {\n const dermPanelProps: any = dermPanelObj.__properties;\n const dermWidgetObj: any = dermPanelObj.__properties.chart ? dermPanelObj.__properties.chart : dermPanelObj.__properties.widget;\n const dermWidgetProps: any = dermWidgetObj.__properties;\n apply_class_mapping(dermWidgetObj);\n apply_panel_property_mapping(dermPanelProps, dermWidgetProps);\n apply_widget_property_mapping(dermPanelProps, dermWidgetProps);\n if (dv.visualization.properties.chartType) {\n dv.visualization.properties.charttype = dv.visualization.properties.chartType;\n }\n } else {\n console.warn(widgetId + \" not found in dermObj\");\n }\n\n function apply_class_mapping(dermWidgetObj: any) {\n dv.visualization.__class = swap_with_supported_class(dermWidgetObj.__class);\n dv.visualization.properties.__class = \"marshaller_VizChartPanel\";\n if (!dv.visualization.properties.widget) dv.visualization.properties.widget = {};\n dv.visualization.properties.widget.__class = dv.visualization.__class;\n\n function swap_with_supported_class(_class: string): string {\n return classMappings[_class] ? classMappings[_class] : _class;\n }\n }\n function apply_panel_property_mapping(dermPanelProps: any, dermWidgetProps: any) {\n dv.visualization.title = dermPanelProps.title || \"\";\n dv.visualization.description = \"\";\n dv.visualization.visibility = dv.visualization.visibility === \"flyout\" ? \"flyout\" : \"normal\";\n dv.visualization.chartType = dv.visualization.__class.split(\"_\")[1];\n for (const propName in dermPanelProps) {\n if (typeof propertyMappings[propName] !== \"undefined\") {\n const newPropName = propertyMappings[propName].name;\n\n if (typeof propertyMappings[propName].transform === \"function\") {\n dv.visualization.properties[newPropName] = propertyMappings[propName].transform(dermPanelProps[propName]);\n } else {\n dv.visualization.properties[newPropName] = dermPanelProps[propName];\n }\n\n }\n }\n if (dermWidgetProps && dermWidgetProps.showLegend && dv.visualization.properties) {\n dv.visualization.properties.legendVisible = true;\n }\n }\n function apply_widget_property_mapping(dermPanelProps: any, dermWidgetProps: any) {\n dv.visualization.title = dv.visualization.title || dermWidgetProps.title || \"\";\n dv.visualization.description = \"\"; // TODO - should this map to anything?\n dv.visualization.visibility = dv.visualization.visibility === \"flyout\" ? \"flyout\" : \"normal\";\n dv.visualization.chartType = dv.visualization.__class.split(\"_\")[1];\n for (const propName in dermWidgetProps) {\n if (typeof propertyMappings[propName] !== \"undefined\") {\n if (propertyMappings[propName] instanceof Array) {\n propertyMappings[propName].forEach((p: any) => {\n const newPropName = p.name;\n dv.visualization.properties.widget[newPropName] = p.transform(dermWidgetProps[propName]);\n if (typeof propertyMappings[propName].transform === \"function\") {\n dv.visualization.properties.widget[newPropName] = propertyMappings[propName].transform(dermWidgetProps[propName]);\n } else {\n dv.visualization.properties.widget[newPropName] = dermWidgetProps[propName];\n }\n });\n } else {\n const newPropName = propertyMappings[propName].name;\n dv.visualization.properties.widget[newPropName] = propertyMappings[propName].transform(dermWidgetProps[propName]);\n }\n }\n }\n }\n }\n}\n\ntype CellPosition = {\n id: string;\n position: [number, number, number, number];\n};\n\ntype DDLProperties = {\n layout: CellPosition[]\n};\n\nfunction apply_to_properties_layout(ddl2: DDL2.Schema, dermObj: any) {\n const retVal: DDLProperties = {\n layout: []\n };\n if (!dermObj || !dermObj.__properties) return;\n dermObj.__properties.content.forEach((cell: any) => {\n const cellPosition: CellPosition = {\n // TODO - if \"id\" could be avoided then layouts could apply to any dashboard with the same number of widgets\n id: cell.__properties.widget.__id,\n position: [\n cell.__properties.gridCol,\n cell.__properties.gridRow,\n cell.__properties.gridColSpan,\n cell.__properties.gridRowSpan\n ]\n };\n retVal.layout.push(cellPosition);\n });\n return retVal;\n}\n\nexport function upgrade(ddl2: DDL2.Schema, dermObj: any) {\n apply_to_dataviews(ddl2, dermObj);\n return apply_to_properties_layout(ddl2, dermObj);\n}\n","import { PKG_NAME, PKG_VERSION } from \"./__package__.ts\";\nimport * as DDL1 from \"./ddl/v1.ts\";\nimport * as DDL2 from \"./ddl/v2.ts\";\nimport { upgrade as dermatologyUpgrade } from \"./dermatology.ts\";\n\ninterface IDatasourceOutput {\n datasource: DDL1.IAnyDatasource;\n output: DDL1.IOutput;\n}\n\ninterface IDatasourceOutputFilter extends IDatasourceOutput {\n filter: DDL1.IFilter;\n}\n\nconst UPGRADE_HEX_CHAR: boolean = false;\nfunction faCharFix(faChar: any): string | undefined {\n if (UPGRADE_HEX_CHAR && typeof faChar === \"string\") {\n return String.fromCharCode(parseInt(faChar));\n }\n return faChar;\n}\n\nclass DDLUpgrade {\n _ddl: DDL1.IDDL;\n _baseUrl: string;\n _wuid?: string;\n _toLowerCase: boolean;\n\n _datasources: { [id: string]: DDL1.IAnyDatasource } = {};\n _datasourceUpdates: { [id: string]: { id: string, output?: string } } = {};\n _visualizations: { [id: string]: DDL1.IAnyVisualization } = {};\n\n _ddl2Datasources: { [id: string]: DDL2.DatasourceType } = {};\n _ddl2DatasourceFields: { [dsid: string]: { [outputID: string]: { [fieldID: string]: DDL2.IField } } } = {};\n\n _ddl2Dataviews: { [id: string]: DDL2.IView } = {};\n _ddl2DataviewActivities: {\n [viewID: string]: {\n project: DDL2.IProject,\n filters: DDL2.IFilter,\n sort: DDL2.ISort,\n groupBy: DDL2.IGroupBy,\n limit: DDL2.ILimit,\n mappings: DDL2.IMappings\n }\n } = {};\n\n constructor(ddl: DDL1.IDDL, baseUrl: string = \"http://localhost:8010\", wuid: string = \"WUID\", toLowerCase = true) {\n this._ddl = ddl;\n this._baseUrl = baseUrl;\n this._wuid = wuid;\n this._toLowerCase = toLowerCase;\n\n this.indexDDL();\n this.readDDL();\n }\n\n toLowerCase(s: string): string {\n return this._toLowerCase ? s.toLowerCase() : s;\n }\n\n isVizDatasourceRoxie(viz: DDL1.IAnyVisualization): boolean {\n if ((viz as any).source) {\n const ds = this._datasources[(viz as any).source.id];\n if (DDL1.isHipieDatasource(ds)) {\n return true;\n }\n }\n return false;\n }\n\n getDatasourceOutputs(dsID: string, vizID: string): IDatasourceOutput[] {\n const retVal: IDatasourceOutput[] = [];\n const datasource = this._datasources[dsID];\n for (const output of datasource.outputs) {\n if (output.notify) {\n for (const notify of output.notify) {\n if (notify === vizID) {\n retVal.push({\n datasource,\n output\n });\n }\n }\n }\n }\n return retVal;\n }\n\n getDatasourceFilters(dsID: string, vizID: string): { [id: string]: IDatasourceOutputFilter } {\n const retVal: { [id: string]: IDatasourceOutputFilter } = {};\n for (const dsOut of this.getDatasourceOutputs(dsID, vizID)) {\n if (dsOut.output.filter) {\n for (const filter of dsOut.output.filter) {\n retVal[filter.fieldid] = {\n datasource: dsOut.datasource,\n output: dsOut.output,\n filter\n };\n }\n }\n }\n return retVal;\n }\n\n indexDDL() {\n for (const dash of this._ddl.dashboards) {\n for (const viz of dash.visualizations) {\n this._visualizations[viz.id] = viz;\n }\n }\n\n for (const ds of this._ddl.datasources) {\n this._datasources[ds.id] = ds;\n for (const output of ds.outputs) {\n if (output.notify) {\n for (const notify of output.notify) {\n this._datasourceUpdates[notify] = {\n id: ds.id,\n output: output.from || output.id\n };\n }\n }\n }\n }\n }\n\n readDDL() {\n for (const ds of this._ddl.datasources) {\n if (DDL1.isWorkunitDatasource(ds)) {\n const ddl2DS: DDL2.IWUResult = {\n type: \"wuresult\",\n id: ds.id,\n url: this._baseUrl,\n wuid: this._wuid!,\n outputs: {}\n };\n for (const output of ds.outputs) {\n this.output2output(output, ddl2DS.outputs);\n }\n this._ddl2Datasources[ds.id] = ddl2DS;\n } else if (DDL1.isDatabombDatasource(ds)) {\n } else {\n const urlParts = ds.URL!.split(\"/WsEcl/submit/query/\");\n const hostParts = urlParts[0];\n const roxieParts = urlParts[1].split(\"/\");\n const ddl2DS: DDL2.IHipieService = {\n type: \"hipie\",\n id: ds.id,\n url: hostParts,\n querySet: roxieParts[0],\n queryID: roxieParts[1],\n inputs: [],\n outputs: {}\n };\n for (const output of ds.outputs) {\n this.output2output(output, ddl2DS.outputs);\n }\n this._ddl2Datasources[ds.id] = ddl2DS;\n }\n }\n for (const dash of this._ddl.dashboards) {\n for (const viz of dash.visualizations) {\n if (viz.type === \"FORM\") {\n this._ddl2Datasources[viz.id] = {\n type: \"form\",\n id: viz.id,\n fields: this.formFields2field(viz.fields)\n };\n this._datasourceUpdates[viz.id] = { id: viz.id };\n } else if (viz.type === \"SLIDER\") {\n this._ddl2Datasources[viz.id] = {\n type: \"form\",\n id: viz.id,\n fields: this.formFields2field(viz.fields, true)\n };\n this._datasourceUpdates[viz.id] = { id: viz.id };\n }\n\n this._ddl2Dataviews[viz.id] = this.anyViz2view(viz);\n }\n }\n\n this.readGroupBy();\n this.readFilters();\n this.readSort();\n this.readMappings();\n }\n\n readGroupBy() {\n for (const dash of this._ddl.dashboards) {\n for (const viz of dash.visualizations) {\n if (viz.fields) {\n const projectTransformations: DDL2.ProjectTransformationType[] = [];\n const groupByColumns: string[] = [];\n const aggrFields: DDL2.IAggregate[] = [];\n for (const field of viz.fields) {\n if (field.properties && field.properties.function) {\n switch (field.properties.function) {\n case \"SUM\":\n case \"MIN\":\n case \"MAX\":\n aggrFields.push({\n type: this.func2aggr(field.properties.function),\n inFieldID: this.toLowerCase(field.properties.params!.param1),\n fieldID: this.toLowerCase(field.id)\n } as DDL2.IAggregate);\n break;\n case \"AVE\":\n aggrFields.push({\n type: this.func2aggr(field.properties.function),\n inFieldID: this.toLowerCase(field.properties.params!.param1),\n baseCountFieldID: field.properties.params!.param2 ? this.toLowerCase(field.properties.params!.param2) : undefined,\n fieldID: this.toLowerCase(field.id)\n } as DDL2.IAggregate);\n break;\n case \"SCALE\":\n if (typeof field.properties.params!.param1 === \"object\") {\n const props: any = field.properties.params!.param1;\n switch (props.function) {\n case \"SUM\":\n case \"MIN\":\n case \"MAX\":\n aggrFields.push({\n type: this.func2aggr(props.function),\n inFieldID: this.toLowerCase(props.params.param1),\n fieldID: this.toLowerCase(field.id)\n });\n break;\n }\n }\n projectTransformations.push({\n type: \"scale\",\n sourceFieldID: this.toLowerCase(field.id),\n fieldID: this.toLowerCase(field.id),\n factor: +field.properties.params!.param2\n });\n break;\n default:\n groupByColumns.push(this.toLowerCase(field.id));\n throw new Error(`Unhandled field function: ${field.properties.function}`);\n }\n } else {\n groupByColumns.push(this.toLowerCase(field.id));\n }\n }\n if (projectTransformations.length) {\n this._ddl2DataviewActivities[viz.id].project.transformations = projectTransformations;\n }\n if (aggrFields.length) {\n this._ddl2DataviewActivities[viz.id].groupBy.groupByIDs = [...groupByColumns];\n this._ddl2DataviewActivities[viz.id].groupBy.aggregates = aggrFields;\n }\n }\n }\n }\n }\n\n func2aggr(func: DDL1.VisualizationFieldFuncitonType): DDL2.IAggregateType {\n switch (func) {\n case \"SUM\":\n return \"sum\";\n case \"AVE\":\n return \"mean\";\n case \"MIN\":\n return \"min\";\n case \"MAX\":\n return \"max\";\n }\n throw new Error(`Unknown DDL1 Function Type: ${func}`);\n }\n\n readMappings() {\n for (const dash of this._ddl.dashboards) {\n for (const viz of dash.visualizations) {\n if (DDL1.isFormVisualization(viz)) {\n } else if (DDL1.isPieVisualization(viz)) {\n this.readPieMappings(viz);\n } else if (DDL1.isChoroVisualization(viz)) {\n this.readChoroMappings(viz);\n } else if (DDL1.isLineVisualization(viz)) {\n this.readLineMappings(viz);\n } else if (DDL1.isTableVisualization(viz)) {\n this.readTableMappings(viz);\n } else if (DDL1.isGraphVisualization(viz)) {\n this.readGraphMappings(viz);\n } else if (DDL1.isSliderVisualization(viz)) {\n this.readSliderMappings(viz);\n } else {\n throw new Error(`Unkown DDL1 mapping type: ${viz.type}`);\n }\n }\n }\n }\n\n readPieMappings(viz: DDL1.IPieVisualization) {\n const mappings = this._ddl2DataviewActivities[viz.id].mappings;\n mappings.transformations.push({\n fieldID: \"label\",\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.mappings.label)\n });\n mappings.transformations.push({\n fieldID: \"weight\",\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.mappings.weight[0])\n });\n }\n\n readChoroMappings(viz: DDL1.IChoroVisualization) {\n const mappings = this._ddl2DataviewActivities[viz.id].mappings;\n mappings.transformations.push({\n fieldID: \"label\",\n type: \"=\",\n sourceFieldID: this.toLowerCase(this.anyChoroMapping2label(viz.source.mappings))\n });\n mappings.transformations.push({\n fieldID: \"weight\",\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.mappings.weight[0])\n });\n }\n\n anyChoroMapping2label(mapping: any) {\n return mapping.state || mapping.county || mapping.geohash;\n }\n\n readLineMappings(viz: DDL1.ILineVisualization) {\n const mappings = this._ddl2DataviewActivities[viz.id].mappings;\n mappings.transformations.push({\n fieldID: viz.source.mappings.x[0],\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.mappings.x[0])\n });\n for (let i = 0; i < viz.source.mappings.y.length; ++i) {\n mappings.transformations.push({\n fieldID: viz.source.mappings.y[i],\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.mappings.y[i])\n });\n }\n }\n\n readTableMappings(viz: DDL1.ITableVisualization) {\n const mappings = this._ddl2DataviewActivities[viz.id].mappings;\n for (let i = 0; i < viz.label.length; ++i) {\n mappings.transformations.push({\n fieldID: viz.label[i],\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.mappings.value[i])\n });\n }\n }\n\n readGraphEnums(valueMappings?: DDL1.IValueMappings, annotation: boolean = false): DDL2.IMapMapping[] {\n const retVal: DDL2.IMapMapping[] = [];\n if (valueMappings) {\n for (const value in valueMappings) {\n const newValue: { [key: string]: string | number | boolean | undefined } = {};\n for (const key in valueMappings[value]) {\n if (key === \"faChar\") {\n newValue[key] = faCharFix(valueMappings[value][key]);\n } else if (annotation && key.indexOf(\"icon_\") === 0) {\n console.warn(\"Deprecated flag property: \" + key);\n newValue[key.split(\"icon_\")[1]] = valueMappings[value][key];\n } else {\n newValue[key] = valueMappings[value][key];\n }\n }\n // remove v1.x \"0\" annotations as they equated to \"nothing\" ---\n if (!annotation || value !== \"0\") {\n retVal.push({\n value,\n newValue\n });\n }\n }\n }\n return retVal;\n }\n\n readGraphMappings(viz: DDL1.IGraphVisualization) {\n const mappings = this._ddl2DataviewActivities[viz.id].mappings;\n mappings.transformations.push({\n fieldID: \"uid\",\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.mappings.uid)\n });\n mappings.transformations.push({\n fieldID: \"label\",\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.mappings.label)\n });\n if (viz.icon.fieldid) {\n mappings.transformations.push({\n fieldID: \"icon\",\n type: \"map\",\n sourceFieldID: this.toLowerCase(viz.icon.fieldid),\n default: { fachar: faCharFix(viz.icon.faChar) },\n mappings: this.readGraphEnums(viz.icon.valuemappings)\n });\n }\n let idx = 0;\n if (viz.flag) {\n for (const flag of viz.flag) {\n if (flag.fieldid) {\n mappings.transformations.push({\n fieldID: `annotation_${idx++}`,\n type: \"map\",\n sourceFieldID: this.toLowerCase(flag.fieldid),\n default: {},\n mappings: this.readGraphEnums(flag.valuemappings, true)\n });\n }\n }\n }\n mappings.transformations.push({\n fieldID: \"links\",\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.link.childfile),\n transformations: [{\n fieldID: \"uid\",\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.link.mappings.uid)\n }]\n });\n }\n\n readSliderMappings(viz: DDL1.ISliderVisualization) {\n const mappings = this._ddl2DataviewActivities[viz.id].mappings;\n mappings.transformations.push({\n fieldID: \"label\",\n type: \"=\",\n sourceFieldID: this.toLowerCase(viz.source.mappings.label)\n });\n }\n\n readFilters() {\n for (const dash of this._ddl.dashboards) {\n for (const viz of dash.visualizations) {\n if (viz.events) {\n for (const eventID in viz.events) {\n const event = viz.events[eventID];\n for (const update of event.updates) {\n const otherViz = this._ddl2Dataviews[update.visualization];\n const dsFilters = this.getDatasourceFilters(update.datasource, otherViz.id);\n if (update.mappings) {\n if (DDL2.isRoxieServiceRef(otherViz.datasource)) {\n for (const key in update.mappings) {\n otherViz.datasource.request.push({\n source: viz.id,\n remoteFieldID: this.toLowerCase(key),\n localFieldID: this.toLowerCase(update.mappings[key])\n } as DDL2.IRequestField);\n }\n } else {\n const condition: DDL2.IFilterCondition = {\n viewID: viz.id,\n mappings: []\n };\n for (const key in update.mappings) {\n const mapping = update.mappings[key];\n const dsFilter = (mapping && dsFilters[mapping]) ? dsFilters[mapping].filter : undefined;\n if (!dsFilter) {\n console.warn(`Select Mapping \"${mapping}\" in viz \"${viz.id}\" not found in filters for \"${otherViz.id}\"`);\n } else {\n condition.mappings.push({\n remoteFieldID: this.toLowerCase(key),\n localFieldID: this.toLowerCase(update.mappings[key]),\n condition: this.rule2condition(dsFilter.rule),\n nullable: dsFilter.nullable\n });\n }\n }\n this._ddl2DataviewActivities[otherViz.id].filters.conditions.push(condition);\n }\n }\n }\n }\n }\n }\n }\n }\n\n rule2condition(_: DDL1.IFilterRule): DDL2.IMappingConditionType {\n switch (_) {\n case \"set\":\n return \"in\";\n case \"notequals\":\n return \"!=\";\n }\n return _;\n }\n\n readSort() {\n for (const dash of this._ddl.dashboards) {\n for (const viz of dash.visualizations) {\n if ((viz as any).source) {\n if ((viz as any).source.sort) {\n const vizSort = this._ddl2DataviewActivities[viz.id].sort;\n vizSort.conditions = ((viz as any).source.sort as string[]).map(s => {\n if (s.indexOf(\"-\") === 0) {\n return {\n fieldID: this.toLowerCase(s.substr(1)),\n descending: true\n } as DDL2.ISortCondition;\n }\n return {\n fieldID: this.toLowerCase(s),\n descending: false\n } as DDL2.ISortCondition;\n });\n }\n if ((viz as any).source.first) {\n const vizLimit = this._ddl2DataviewActivities[viz.id].limit;\n vizLimit.limit = +(viz as any).source.first;\n }\n }\n }\n }\n }\n\n anyViz2view(viz: DDL1.IAnyVisualization): DDL2.IView {\n const project: DDL2.IProject = {\n type: \"project\",\n transformations: []\n };\n const filters: DDL2.IFilter = {\n type: \"filter\",\n conditions: []\n };\n const groupBy: DDL2.IGroupBy = {\n type: \"groupby\",\n groupByIDs: [],\n aggregates: []\n };\n const sort: DDL2.ISort = {\n type: \"sort\",\n conditions: []\n };\n const limit: DDL2.ILimit = {\n type: \"limit\",\n limit: 0\n };\n const mappings: DDL2.IMappings = {\n type: \"mappings\",\n transformations: []\n };\n this._ddl2DataviewActivities[viz.id] = {\n project,\n filters,\n sort,\n groupBy,\n limit,\n mappings\n };\n const datasourceRef: DDL2.IDatasourceBaseRef | DDL2.IRoxieServiceRef = this.isVizDatasourceRoxie(viz) ? {\n id: this._datasourceUpdates[viz.id].id,\n request: [],\n output: this._datasourceUpdates[viz.id].output\n } : {\n id: this._datasourceUpdates[viz.id].id,\n output: this._datasourceUpdates[viz.id].output\n };\n return {\n id: viz.id,\n datasource: datasourceRef,\n activities: [\n project,\n filters,\n sort,\n groupBy,\n limit\n ],\n visualization: {\n id: viz.id,\n title: viz.title || \"\",\n description: \"\",\n visibility: viz.properties && viz.properties.flyout === true ? \"flyout\" : \"normal\",\n ...this.type2chartType(viz.type),\n mappings,\n properties: (viz.properties || {}) as DDL2.IWidgetProperties\n }\n };\n }\n\n type2chartType(chartType: DDL1.VisualizationType): { chartType: string, __class: string } {\n switch (chartType) {\n case \"LINE\":\n return { chartType: \"Line\", __class: \"chart_Line\" };\n case \"BUBBLE\":\n return { chartType: \"Bubble\", __class: \"chart_Bubble\" };\n case \"PIE\":\n return { chartType: \"Pie\", __class: \"chart_Pie\" };\n case \"BAR\":\n return { chartType: \"Column\", __class: \"chart_Column\" };\n case \"FORM\":\n return { chartType: \"FieldForm\", __class: \"form_FieldForm\" };\n case \"WORD_CLOUD\":\n return { chartType: \"WordCloud\", __class: \"chart_WordCloud\" };\n case \"CHORO\":\n return { chartType: \"ChoroplethStates\", __class: \"map_ChoroplethStates\" };\n case \"SUMMARY\":\n return { chartType: \"Summary\", __class: \"chart_Summary\" };\n case \"SLIDER\":\n return { chartType: \"FieldForm\", __class: \"form_FieldForm\" };\n case \"HEAT_MAP\":\n return { chartType: \"HeatMap\", __class: \"other_HeatMap\" };\n case \"2DCHART\":\n return { chartType: \"Column\", __class: \"chart_Column\" };\n case \"GRAPH\":\n return { chartType: \"AdjacencyGraph\", __class: \"graph_AdjacencyGraph\" };\n case \"TABLE\":\n default:\n return { chartType: \"Table\", __class: \"dgrid_Table\" };\n }\n }\n\n formFields2field(fields?: DDL1.IVisualizationField[], slider: boolean = false): DDL2.IField[] {\n if (!fields) return [];\n return fields.map(field => {\n switch (field.properties.type) {\n case \"range\":\n return {\n type: \"range\",\n id: field.id,\n default: (field.properties.default ? field.properties.default as DDL2.Range : undefined)\n };\n case \"dataset\":\n return {\n type: \"dataset\",\n id: field.id,\n default: [],\n children: []\n };\n default:\n return {\n type: this.formFieldType2fieldType(field.properties.datatype, slider),\n id: field.id,\n default: field.properties.default ? field.properties.default[0] : undefined\n };\n }\n });\n }\n\n formFieldType2fieldType(fieldType: DDL1.VisualizationFieldType, slider: boolean): \"string\" | \"number\" | \"boolean\" {\n switch (fieldType) {\n case \"bool\":\n case \"boolean\":\n return \"boolean\";\n case \"integer\":\n case \"unsigned\":\n case \"float\":\n case \"double\":\n case \"real\":\n return \"number\";\n case \"string\":\n return \"string\";\n default:\n return slider ? \"number\" : \"string\";\n }\n }\n\n output2output(output: DDL1.IOutput, target: DDL2.OutputDict) {\n target[output.from || output.id] = {\n fields: this.filters2fields(output.filter)\n };\n }\n\n filters2fields(filters?: DDL1.IFilter[]): DDL2.IField[] {\n if (!filters) return [];\n return filters.filter(filter => {\n const idParts = filter.fieldid.split(\"-\");\n return idParts.length === 1 || idParts[1] === \"range\";\n }).map(filter => {\n const idParts = filter.fieldid.split(\"-\");\n const retVal: DDL2.IFieldString = {\n type: \"string\",\n id: idParts[0]\n };\n return retVal;\n });\n }\n\n getVizField(vizID: string, fieldID: string): DDL2.IField {\n return {\n type: \"string\",\n id: \"\",\n default: \"\"\n };\n }\n\n writeDatasources(): DDL2.DatasourceType[] {\n const retVal: DDL2.DatasourceType[] = [];\n for (const id in this._ddl2Datasources) {\n retVal.push(this._ddl2Datasources[id]);\n }\n return retVal;\n }\n\n writeDataviews(): DDL2.IView[] {\n const retVal: DDL2.IView[] = [];\n for (const id in this._ddl2Dataviews) {\n retVal.push(this._ddl2Dataviews[id]);\n }\n return retVal;\n }\n\n writeProperties(): DDL2.IProperties | undefined {\n return {\n // TODO\n };\n }\n\n write(): DDL2.Schema {\n return {\n version: \"2.2.1\",\n createdBy: {\n name: PKG_NAME,\n version: PKG_VERSION\n },\n datasources: this.writeDatasources(),\n dataviews: this.writeDataviews(),\n properties: this.writeProperties()\n };\n }\n}\n\nexport function upgrade(ddl: DDL1.IDDL, baseUrl?: string, wuid?: string, toLowerCase: boolean = true, dermatologyJson = {}): DDL2.Schema {\n const ddlUp = new DDLUpgrade(ddl, baseUrl, wuid, toLowerCase);\n const retVal = ddlUp.write();\n retVal.properties = dermatologyUpgrade(retVal, dermatologyJson);\n return retVal;\n}\n","import * as _Ajv from \"ajv\";\nimport * as DDL from \"./ddl/v1.ts\";\nimport * as DDL2 from \"./ddl/v2.ts\";\n\nconst Ajv = (_Ajv as any).default || _Ajv;\n\nexport const ddl2Schema: object = _ddl2Schema;\n\nconst options: _Ajv.Options = {\n allErrors: false,\n verbose: true,\n jsonPointers: false\n};\n\nfunction doValidate(ddl: DDL.DDLSchema | DDL2.Schema, schema: DDL.DDLSchema | DDL2.Schema) {\n const ajv: _Ajv.Ajv = new Ajv(options);\n const validate = ajv.compile(schema);\n const success = validate(ddl);\n return {\n success,\n errors: validate.errors\n };\n}\n\n/* Not needed ---\n// @ts-ignore\nimport * as ddlSchema from \"../schema/v1.json\";\n\nexport function validate(ddl: DDL.DDLSchema) {\n return doValidate(ddl, ddlSchema);\n}\n*/\n\nimport _ddl2Schema from \"../schema/v2.json\" with { type: \"json\" };\n\nexport function validate2(ddl: DDL2.Schema) {\n return doValidate(ddl, _ddl2Schema as any);\n}\n","export * from \"./__package__.ts\";\nimport * as DDL1 from \"./ddl/v1.ts\";\nimport * as DDL2 from \"./ddl/v2.ts\";\nexport * from \"./upgrade.ts\";\nexport * from \"./validate.ts\";\n\nexport { DDL1, DDL2 };\n\nexport function isDDL2Schema(ref: DDL1.DDLSchema | DDL2.Schema): ref is DDL2.Schema {\n return (ref as DDL2.Schema).version !== undefined && (ref as DDL2.Schema).datasources !== undefined && (ref as DDL2.Schema).dataviews !== undefined;\n}\n"],"names":["PKG_NAME","PKG_VERSION","BUILD_VERSION","isWorkunitDatasource","ref","WUID","isDatabombDatasource","databomb","isHipieDatasource","URL","isPieVisualization","viz","type","isLineVisualization","isChoroVisualization","isTableVisualization","isSliderVisualization","isGraphVisualization","isHeatMapVisualization","isFormVisualization","isUSStateMapping","mappings","state","isUSCountyMapping","county","isGeohashMapping","geohash","__name","isDatabombRef","isWUResultRef","isRoxieServiceRef","output","request","isIFilterCondition","fc","viewID","isFilterActivity","activity","isProjectActivity","isMappingsActivity","isGroupByActivity","isSortActivity","isLimitActivity","classMappings","c3chart_Bar","c3chart_Column","c3chart_Pie","c3chart_Area","c3chart_Line","amchart_Bar","amchart_Column","amchart_Pie","amchart_Area","amchart_Line","google_Bar","google_Column","google_Pie","google_Area","google_Line","other_Table","propertyMappings","xAxisLabelRotation","name","transform","n","tooltipLabelColor","tooltipSeriesColor","tooltipValueColor","tooltipValueFormat","timePattern","smoothLines","holePercent","flip","bottomText","xAxisTypeTimePattern","yAxisTypeTimePattern","valueFormat","stacked","showYGrid","showXGrid","showValueLabel","low","high","fillOpacity","areaFillOpacity","showToolbar","showCSV","findKeyVal","object","key","val","value","k","apply_to_dataviews","ddl2","dermObj","apply_to_dataview","dv","widgetId","id","dermPanelObj","dermPanelProps","__properties","dermWidgetObj","chart","widget","dermWidgetProps","apply_class_mapping","apply_panel_property_mapping","apply_widget_property_mapping","visualization","properties","chartType","charttype","console","warn","swap_with_supported_class","_class","__class","title","description","visibility","split","propName","newPropName","showLegend","legendVisible","Array","forEach","p","dataviews","apply_to_properties_layout","retVal","layout","content","cell","cellPosition","__id","position","gridCol","gridRow","gridColSpan","gridRowSpan","push","upgrade","faCharFix","faChar","_DDLUpgrade","_ddl","_baseUrl","_wuid","_toLowerCase","_datasources","_datasourceUpdates","_visualizations","_ddl2Datasources","_ddl2DatasourceFields","_ddl2Dataviews","_ddl2DataviewActivities","constructor","ddl","baseUrl","wuid","toLowerCase","this","indexDDL","readDDL","s","isVizDatasourceRoxie","source","DDL1.isHipieDatasource","getDatasourceOutputs","dsID","vizID","datasource","outputs","notify","getDatasourceFilters","dsOut","filter","fieldid","dash","dashboards","visualizations","ds","datasources","from","DDL1.isWorkunitDatasource","ddl2DS","url","output2output","DDL1.isDatabombDatasource","urlParts","hostParts","roxieParts","querySet","queryID","inputs","fields","formFields2field","anyViz2view","readGroupBy","readFilters","readSort","readMappings","projectTransformations","groupByColumns","aggrFields","field","function","func2aggr","inFieldID","params","param1","fieldID","baseCountFieldID","param2","props","sourceFieldID","factor","Error","length","project","transformations","groupBy","groupByIDs","aggregates","func","DDL1.isFormVisualization","DDL1.isPieVisualization","readPieMappings","DDL1.isChoroVisualization","readChoroMappings","DDL1.isLineVisualization","readLineMappings","DDL1.isTableVisualization","readTableMappings","DDL1.isGraphVisualization","readGraphMappings","DDL1.isSliderVisualization","readSliderMappings","label","weight","anyChoroMapping2label","mapping","x","i","y","readGraphEnums","valueMappings","annotation","newValue","indexOf","uid","icon","default","fachar","valuemappings","idx","flag","link","childfile","events","eventID","event","update","updates","otherViz","dsFilters","DDL2.isRoxieServiceRef","remoteFieldID","localFieldID","condition","dsFilter","rule2condition","rule","nullable","filters","conditions","_","sort","map","substr","descending","first","limit","datasourceRef","activities","flyout","type2chartType","slider","children","formFieldType2fieldType","datatype","fieldType","target","filters2fields","idParts","getVizField","writeDatasources","writeDataviews","writeProperties","write","version","createdBy","DDLUpgrade","dermatologyJson","dermatologyUpgrade","Ajv","_Ajv","ddl2Schema","_ddl2Schema","options","allErrors","verbose","jsonPointers","doValidate","schema","validate","compile","success","errors","validate2","isDDL2Schema"],"mappings":"iGAAO,MAAMA,EAAW,oBACXC,EAAc,QACdC,EAAgB,SC0BtB,SAASC,EAAqBC,GACjC,YAA6C,IAArCA,EAA4BC,IACxC,CAKO,SAASC,EAAqBF,GACjC,OAAiD,IAAzCA,EAA4BG,QACxC,CAKO,SAASC,EAAkBJ,GAC9B,YAAyC,IAAjCA,EAAyBK,GACrC,CA0JO,SAASC,EAAmBC,GAC/B,MAA2C,QAAnCA,EAA0BC,MAAsD,QAAnCD,EAA0BC,IACnF,CAMO,SAASC,EAAoBF,GAChC,MAA4C,SAApCA,EAA2BC,IACvC,CAUO,SAASE,EAAqBH,GACjC,MAA6C,UAArCA,EAA4BC,IACxC,CAOO,SAASG,EAAqBJ,GACjC,MAA6C,UAArCA,EAA4BC,IACxC,CAOO,SAASI,EAAsBL,GAClC,MAA8C,WAAtCA,EAA6BC,IACzC,CAsBO,SAASK,EAAqBN,GACjC,MAA6C,UAArCA,EAA4BC,IACxC,CAMO,SAASM,EAAuBP,GACnC,MAA+C,aAAvCA,EAA8BC,IAC1C,CAKO,SAASO,EAAoBR,GAChC,MAA4C,SAApCA,EAA2BC,IACvC,CAwBO,SAASQ,EAAiBC,GAC7B,YAAoD,IAA5CA,EAAkCC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