@linkurious/ogma-linkurious-parser 4.0.0 → 4.0.3
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/README.md +1 -1
- package/dist/captions/captions.js +4 -5
- package/dist/captions/captions.js.map +1 -1
- package/dist/filters/filters.d.ts +1 -1
- package/dist/filters/filters.js +1 -0
- package/dist/filters/filters.js.map +1 -1
- package/dist/index.js +34 -33
- package/dist/index.js.map +1 -1
- package/dist/ogma/features/OgmaStore.js +2 -1
- package/dist/ogma/features/OgmaStore.js.map +1 -1
- package/dist/ogma/features/captions.js +1 -0
- package/dist/ogma/features/captions.js.map +1 -1
- package/dist/ogma/features/reactive.js +1 -0
- package/dist/ogma/features/reactive.js.map +1 -1
- package/dist/ogma/features/selectors.d.ts +5 -5
- package/dist/ogma/features/selectors.js +21 -12
- package/dist/ogma/features/selectors.js.map +1 -1
- package/dist/ogma/features/styles.d.ts +7 -7
- package/dist/ogma/features/styles.js +1 -0
- package/dist/ogma/features/styles.js.map +1 -1
- package/dist/ogma/features/transformations.d.ts +1 -1
- package/dist/ogma/features/transformations.js +16 -17
- package/dist/ogma/features/transformations.js.map +1 -1
- package/dist/ogma/index.js +14 -18
- package/dist/ogma/index.js.map +1 -1
- package/dist/styles/edgeAttributes.d.ts +8 -8
- package/dist/styles/edgeAttributes.js +16 -15
- package/dist/styles/edgeAttributes.js.map +1 -1
- package/dist/styles/itemAttributes.d.ts +24 -28
- package/dist/styles/itemAttributes.js +31 -23
- package/dist/styles/itemAttributes.js.map +1 -1
- package/dist/styles/nodeAttributes.d.ts +8 -8
- package/dist/styles/nodeAttributes.js +23 -20
- package/dist/styles/nodeAttributes.js.map +1 -1
- package/dist/styles/styleRule.d.ts +8 -8
- package/dist/styles/styleRule.js +2 -0
- package/dist/styles/styleRule.js.map +1 -1
- package/dist/styles/styleRules.d.ts +5 -5
- package/dist/styles/styleRules.js +20 -16
- package/dist/styles/styleRules.js.map +1 -1
- package/dist/tools/colorPalette.js +1 -0
- package/dist/tools/colorPalette.js.map +1 -1
- package/dist/tools/ogmaTool.js +1 -0
- package/dist/tools/ogmaTool.js.map +1 -1
- package/dist/tools/tools.js +2 -1
- package/dist/tools/tools.js.map +1 -1
- package/package.json +5 -5
|
@@ -103,7 +103,7 @@ export declare class StylesViz {
|
|
|
103
103
|
/**
|
|
104
104
|
* Create / refresh an ogma rule for node colors
|
|
105
105
|
*/
|
|
106
|
-
refreshNodeColors(colorStyleRules: Array<LKStyleRule
|
|
106
|
+
refreshNodeColors(colorStyleRules: Array<LKStyleRule<INodeStyle>>): void;
|
|
107
107
|
/**
|
|
108
108
|
* Return an array of StyleRules with only the style that need to be applied
|
|
109
109
|
*/
|
|
@@ -120,33 +120,33 @@ export declare class StylesViz {
|
|
|
120
120
|
*
|
|
121
121
|
* @param {Array<any>} iconStyleRules
|
|
122
122
|
*/
|
|
123
|
-
refreshNodeIcons(iconStyleRules: Array<LKStyleRule
|
|
123
|
+
refreshNodeIcons(iconStyleRules: Array<LKStyleRule<INodeStyle>>): void;
|
|
124
124
|
/**
|
|
125
125
|
* Create / refresh an ogma rule for node sizes
|
|
126
126
|
*
|
|
127
127
|
* @param {Array<any>} sizeStyleRules
|
|
128
128
|
*/
|
|
129
|
-
refreshNodeSize(sizeStyleRules: Array<LKStyleRule
|
|
129
|
+
refreshNodeSize(sizeStyleRules: Array<LKStyleRule<INodeStyle>>): void;
|
|
130
130
|
/**
|
|
131
131
|
* Create / refresh an ogma rule for node images
|
|
132
132
|
*
|
|
133
133
|
* @param {Array<any>} shapeStyleRules
|
|
134
134
|
*/
|
|
135
|
-
refreshNodeShape(shapeStyleRules: Array<LKStyleRule
|
|
135
|
+
refreshNodeShape(shapeStyleRules: Array<LKStyleRule<INodeStyle>>): void;
|
|
136
136
|
/**
|
|
137
137
|
* Create / refresh an ogma rule for edge colors
|
|
138
138
|
*/
|
|
139
|
-
refreshEdgeColors(colorStyleRules: Array<LKStyleRule
|
|
139
|
+
refreshEdgeColors(colorStyleRules: Array<LKStyleRule<IEdgeStyle>>): void;
|
|
140
140
|
/**
|
|
141
141
|
* Create / refresh an ogma rule for edge width
|
|
142
142
|
*
|
|
143
143
|
* @param {Array<LKStyleRule>} widthStyleRules
|
|
144
144
|
*/
|
|
145
|
-
refreshEdgeWidth(widthStyleRules: Array<LKStyleRule
|
|
145
|
+
refreshEdgeWidth(widthStyleRules: Array<LKStyleRule<IEdgeStyle>>): void;
|
|
146
146
|
/**
|
|
147
147
|
* Create / refresh an ogma rule for edge width
|
|
148
148
|
*
|
|
149
149
|
* @param {Array<LKStyleRule>} shapeStyleRules
|
|
150
150
|
*/
|
|
151
|
-
refreshEdgeShape(shapeStyleRules: Array<LKStyleRule
|
|
151
|
+
refreshEdgeShape(shapeStyleRules: Array<LKStyleRule<IEdgeStyle>>): void;
|
|
152
152
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/ogma/features/styles.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAsBb,6BASe;AACf,6CAAwC;AAYxC,MAAM,2BAA2B,GAAgD;IAC/E,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,eAAe,EAAE,MAAM;QACvB,cAAc,EAAE,CAAC;KAClB;IACD,WAAW,EAAE,EAAC,KAAK,EAAE,CAAC,EAAC;IACvB,OAAO,EAAE,KAAK;CACf,CAAC;AAEF,MAAM,2BAA2B,GAAgD;IAC/E,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,eAAe,EAAE,MAAM;QACvB,cAAc,EAAE,CAAC;KAClB;IACD,OAAO,EAAE,KAAK;CACf,CAAC;AAEF,MAAM,uBAAuB,GAAG;IAC9B,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,CAAC;IACR,aAAa,EAAE,QAAQ;IACvB,WAAW,EAAE,CAAC;IACd,oBAAoB,EAAE,KAAK;CAK5B,CAAC;AAEF,MAAM,uBAAuB,GAAG;I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F;AA5qBD,8BA4qBC","sourcesContent":["'use strict';\n\nimport * as o from '@linkurious/ogma';\nimport {\n Edge,\n EdgeAttributesValue,\n NodeAttributesValue,\n StyleClass,\n StyleRule\n} from '@linkurious/ogma';\nimport {\n GenericObject,\n IEdgeStyle,\n INodeStyle,\n IStyleRule,\n LkEdgeData,\n LkNodeData,\n OgmaEdgeShape,\n OgmaNodeShape,\n TextOptions\n} from '@linkurious/rest-client';\n\nimport {\n BASE_GREY,\n EdgeAttributes,\n LKOgma,\n NodeAttributes,\n OgmaTools,\n StyleRule as LKStyleRule,\n StyleRules,\n StyleType\n} from '../..';\nimport {Tools} from '../../tools/tools';\n\nexport interface StylesConfig {\n nodeColorStyleRules: Array<LKStyleRule>;\n nodeIconStyleRules: Array<LKStyleRule>;\n nodeSizeStyleRules: Array<LKStyleRule>;\n nodeShapeStyleRules?: Array<LKStyleRule>;\n edgeColorStyleRules: Array<LKStyleRule>;\n edgeWidthStyleRules: Array<LKStyleRule>;\n edgeShapeStyleRules?: Array<LKStyleRule>;\n}\n\nconst HOVERED_SELECTED_NODE_STYLE: NodeAttributesValue<LkNodeData, LkEdgeData> = {\n text: {\n style: 'bold',\n backgroundColor: '#fff',\n minVisibleSize: 0\n },\n outerStroke: {width: 2},\n outline: false\n};\n\nconst HOVERED_SELECTED_EDGE_STYLE: EdgeAttributesValue<LkEdgeData, LkNodeData> = {\n text: {\n style: 'bold',\n backgroundColor: '#fff',\n minVisibleSize: 0\n },\n outline: false\n};\n\nconst NODE_HALO_CONFIGURATION = {\n color: '#FFF',\n width: 7,\n scalingMethod: 'scaled',\n strokeWidth: 0,\n hideNonAdjacentEdges: false\n} as {\n color: '#FFF';\n width: 7;\n strokeWidth: 0;\n};\n\nconst EDGE_HALO_CONFIGURATION = {\n color: '#FFF',\n scalingMethod: 'scaled',\n width: 4\n} as {\n color: '#FFF';\n width: 4;\n};\n\nconst DEFAULT_OGMA_FONT = \"'roboto', sans-serif\";\nconst DARK_FONT_COLOR = '#000';\nconst CLEAR_FONT_COLOR = '#FFF';\nconst ITEM_DEFAULT_COLOR = '#7f7f7f';\nexport const FILTER_OPACITY = 0.2;\n\nexport class StylesViz {\n private _ogma: LKOgma;\n private _exportClass!: StyleClass;\n private _nodeDefaultStylesRules!: StyleRule<LkNodeData, LkEdgeData>;\n // @ts-ignore\n private _nodeDefaultHaloRules!: StyleRule<LkNodeData, LkEdgeData>;\n private _edgeDefaultStylesRules!: StyleRule<LkNodeData, LkEdgeData>;\n // @ts-ignore\n private _edgeDefaultHaloRules!: StyleRule<LkNodeData, LkEdgeData>;\n\n private _nodeAttributes: NodeAttributes = new NodeAttributes({});\n private _edgeAttributes: EdgeAttributes = new EdgeAttributes({});\n\n private _ogmaNodeColor!: StyleRule;\n private _ogmaNodeIcon!: StyleRule;\n private _ogmaNodeSize!: StyleRule;\n private _ogmaNodeShape!: StyleRule;\n private _ogmaEdgeColor!: StyleRule;\n private _ogmaEdgeWidth!: StyleRule;\n private _ogmaEdgeShape!: StyleRule;\n private _defaultConfiguration: {\n node: {\n nodeRadius?: number;\n shape?: OgmaNodeShape;\n text?: TextOptions & {\n nodePosition?: 'right' | 'left' | 'top' | 'bottom' | 'center';\n };\n };\n edge: {\n edgeWidth?: number;\n shape?: OgmaEdgeShape;\n text?: TextOptions;\n };\n };\n\n constructor(\n ogma: LKOgma,\n configuration: {\n node: {\n nodeRadius?: number;\n shape?: OgmaNodeShape;\n text?: TextOptions & {\n nodePosition?: 'right' | 'left' | 'top' | 'bottom' | 'center';\n };\n };\n edge: {\n edgeWidth?: number;\n shape?: OgmaEdgeShape;\n text?: TextOptions;\n };\n }\n ) {\n this._ogma = ogma;\n this._defaultConfiguration = configuration;\n }\n\n /**\n * Set nodes default styles based on the configuration\n */\n public setNodesDefaultStyles(): void {\n // setting selection and hover attributes\n this._ogma.styles.setHoveredNodeAttributes(HOVERED_SELECTED_NODE_STYLE);\n this._ogma.styles.setSelectedNodeAttributes(HOVERED_SELECTED_NODE_STYLE);\n // setting default styles\n this._nodeDefaultStylesRules = this._ogma.styles.addRule({\n nodeAttributes: {\n text: {\n padding: 5,\n minVisibleSize:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.minVisibleSize\n ? this._defaultConfiguration.node.text.minVisibleSize\n : 12,\n maxLineLength:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.maxLineLength !== undefined\n ? this._defaultConfiguration.node.text.maxLineLength\n : 30,\n position:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.nodePosition !== undefined\n ? this._defaultConfiguration.node.text.nodePosition\n : 'bottom',\n backgroundColor:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.backgroundColor !== undefined\n ? this._defaultConfiguration.node.text.backgroundColor\n : 'null',\n font:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.font !== undefined\n ? this._defaultConfiguration.node.text.font\n : \"'roboto', sans-serif\",\n color:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.color !== undefined\n ? this._defaultConfiguration.node.text.color\n : 'black',\n size:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.size !== undefined\n ? this._defaultConfiguration.node.text.size\n : 14,\n margin: 5\n },\n radius: this.defaultNodeRadius(this._defaultConfiguration.node),\n icon: {\n minVisibleSize: 15\n },\n color: ITEM_DEFAULT_COLOR,\n shape:\n this._defaultConfiguration.node.shape !== undefined\n ? this._defaultConfiguration.node.shape\n : ('circle' as OgmaNodeShape),\n innerStroke: {\n width: 3\n },\n outline: false\n }\n });\n }\n\n /**\n * Set edges default styles based on the configuration\n */\n public setEdgesDefaultStyles(): void {\n // setting selection and hover attributes\n this._ogma.styles.setHoveredEdgeAttributes(HOVERED_SELECTED_EDGE_STYLE);\n this._ogma.styles.setSelectedEdgeAttributes(HOVERED_SELECTED_EDGE_STYLE);\n // setting default styles\n this._edgeDefaultStylesRules = this._ogma.styles.addRule({\n edgeAttributes: {\n text: {\n minVisibleSize:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.minVisibleSize\n ? this._defaultConfiguration.edge.text.minVisibleSize\n : 3,\n maxLineLength:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.maxLineLength !== undefined\n ? this._defaultConfiguration.edge.text.maxLineLength\n : 30,\n backgroundColor:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.backgroundColor !== undefined\n ? this._defaultConfiguration.edge.text.backgroundColor\n : null,\n font:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.font !== undefined\n ? this._defaultConfiguration.edge.text.font\n : \"'roboto', sans-serif\",\n color:\n this._defaultConfiguration.edge !== undefined &&\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.color !== undefined\n ? this._defaultConfiguration.edge.text.color\n : 'black',\n size:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.size !== undefined\n ? this._defaultConfiguration.edge.text.size\n : 14\n },\n width: this.defaultEdgeWidth(this._defaultConfiguration.edge),\n shape:\n this._defaultConfiguration.edge.shape !== undefined\n ? this._defaultConfiguration.edge.shape\n : 'arrow',\n color: ITEM_DEFAULT_COLOR\n }\n });\n }\n\n /**\n * Set nodes default styles based on the configuration\n */\n public setNodesDefaultHalo(): void {\n // setting default halo style\n this._nodeDefaultHaloRules = this._ogma.styles.addRule({\n nodeSelector: (node) => node && !node.hasClass('filtered'),\n nodeAttributes: {\n halo: (node) => {\n if (\n node !== undefined &&\n !node.hasClass('filtered') &&\n (node.isSelected() ||\n node.getAdjacentNodes({}).isSelected().includes(true) ||\n node.getAdjacentEdges().isSelected().includes(true))\n ) {\n return {\n ...NODE_HALO_CONFIGURATION,\n scalingMethod: this._ogma.geo.enabled() ? 'fixed' : 'scaled'\n };\n }\n return null;\n }\n },\n // recalculate the rule *only* when itself or adjacent\n // elements change their selection status\n nodeDependencies: {\n self: {\n selection: true\n },\n adjacentNodes: {\n selection: true\n },\n adjacentEdges: {\n selection: true\n }\n }\n });\n }\n\n /**\n * Set edges default styles based on the configuration\n */\n public setEdgesDefaultHalo(): void {\n // setting default halo styles\n this._edgeDefaultHaloRules = this._ogma.styles.addRule({\n edgeSelector: (edge: Edge) =>\n edge && edge.getSource() && edge.getTarget() && !edge.hasClass('filtered'),\n edgeAttributes: {\n halo: (edge) => {\n if (\n edge &&\n !edge.hasClass('filtered') &&\n (edge.isSelected() || edge.getSource().isSelected() || edge.getTarget().isSelected())\n ) {\n return {\n ...EDGE_HALO_CONFIGURATION,\n scalingMethod: this._ogma.geo.enabled() ? 'fixed' : 'scaled'\n };\n }\n return null;\n }\n },\n // this rule will only be invoked when the selection status\n // of the edge or it's extremities is changed\n edgeDependencies: {\n self: {\n selection: true\n },\n extremities: {\n selection: true\n }\n }\n });\n }\n\n /**\n * Return the default node radius set in configuration or 5\n *\n * @returns {number}\n */\n private defaultNodeRadius(styles: any): number {\n return this.defaultStylesHas(styles, ['nodeRadius']) ? styles.nodeRadius : 5;\n }\n\n /**\n * Return the default edge width set in configuration or 1\n *\n * @returns {number}\n */\n private defaultEdgeWidth(styles: any): number {\n return this.defaultStylesHas(styles, ['edgeWidth']) ? styles.edgeWidth : 1;\n }\n\n /**\n * Check if a style property exists in the default styles object\n */\n private defaultStylesHas(styles: GenericObject<unknown>, propertyPath: Array<string>): boolean {\n if (!Tools.isDefined(styles)) {\n return false;\n }\n return Tools.getIn(styles, propertyPath) !== undefined;\n }\n\n /**\n * Set styles for the class \"filtered\"\n */\n public setFilterClass(): void {\n this._ogma.styles.createClass({\n name: 'filtered',\n nodeAttributes: {\n opacity: FILTER_OPACITY,\n layer: -1,\n detectable: false,\n badges: {\n topRight: {\n text: null\n },\n bottomRight: {\n text: null\n }\n },\n text: null,\n color: 'rgb(240, 240, 240)',\n innerStroke: {\n width: 1,\n color: BASE_GREY,\n minVisibleSize: 1\n },\n shape: 'circle',\n image: null,\n icon: null,\n radius: '100%'\n },\n edgeAttributes: {\n opacity: FILTER_OPACITY,\n layer: -1,\n detectable: false,\n text: null,\n color: BASE_GREY,\n shape: 'line',\n width: 0.2\n }\n });\n }\n\n /**\n * Set the class for exported nodes and edges\n */\n public setExportClass(textWrappingLength?: boolean): void {\n if (!this._exportClass) {\n this._exportClass = this._ogma.styles.createClass({\n name: 'exported',\n nodeAttributes: {\n text: {\n minVisibleSize: 0,\n size: 12,\n maxLineLength: textWrappingLength ? 30 : 0\n },\n halo: null\n },\n edgeAttributes: {\n text: {\n minVisibleSize: 0,\n size: 12\n },\n halo: null\n }\n });\n } else {\n this._exportClass.update({\n nodeAttributes: {\n text: {\n maxLineLength: textWrappingLength ? 30 : 0\n },\n halo: null\n }\n });\n }\n }\n\n /**\n * Set the rule to display badges\n */\n public setBadgeRule() {\n this._ogma.styles.createClass({\n name: 'degreeIndicator',\n nodeAttributes: {\n badges: {\n topRight: (node) => {\n if (node !== undefined) {\n const degree = Tools.getHiddenNeighbors(node.toList());\n const badgeContent = Tools.formatNumber(degree);\n if (degree > 0) {\n const nodeColor = Array.isArray(node.getAttribute('color'))\n ? node.getAttribute('color')![0]\n : node.getAttribute('color');\n const textColor = OgmaTools.isBright(nodeColor as o.Color)\n ? DARK_FONT_COLOR\n : CLEAR_FONT_COLOR;\n const isSupernode = node.getData(['statistics', 'supernode']);\n let content = null;\n if (+badgeContent !== 0) {\n content = isSupernode ? badgeContent + '+' : badgeContent;\n }\n return {\n color: 'inherit',\n minVisibleSize: 20,\n stroke: {\n width: 0,\n color: null\n },\n text: {\n font:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.font !== undefined\n ? this._defaultConfiguration.node.text.font\n : DEFAULT_OGMA_FONT,\n scale: 0.4,\n color: textColor,\n content: content\n }\n };\n }\n }\n }\n }\n }\n });\n this._ogma.styles.createClass({\n name: 'pinnedIndicator',\n nodeAttributes: {\n badges: {\n bottomRight: (node) => {\n if (node !== undefined && !node.getAttribute('layoutable')) {\n const nodeColor = Array.isArray(node.getAttribute('color'))\n ? node.getAttribute('color')![0]\n : node.getAttribute('color');\n const textColor = OgmaTools.isBright(nodeColor as o.Color)\n ? DARK_FONT_COLOR\n : CLEAR_FONT_COLOR;\n return {\n color: 'inherit',\n minVisibleSize: 20,\n stroke: {\n width: 0,\n color: null\n },\n text: {\n font: 'FontAwesome',\n scale: 0.4,\n color: textColor,\n content: node.getAttribute('layoutable') ? null : '\\uf08d'\n }\n };\n }\n }\n }\n },\n nodeDependencies: {\n self: {attributes: ['layoutable']}\n }\n });\n this._ogma.events.on('addNodes', (nodesEvent) => nodesEvent.nodes.addClass('degreeIndicator'));\n this._ogma.events.on('addNodes', (nodesEvent) => nodesEvent.nodes.addClass('pinnedIndicator'));\n }\n\n /**\n * Delete the rule to display badges\n */\n public deleteBadgeRule() {\n this._ogma.getNodes().removeClasses(['degreeIndicator', 'pinnedIndicator'], 0);\n }\n\n /**\n * set text overlap to true or false\n *\n * @param {boolean} overlap\n */\n public toggleTextOverlap(overlap?: boolean): void {\n this._ogma.setOptions({texts: {preventOverlap: overlap}});\n }\n\n /**\n * refresh nodes and edge rules\n *\n */\n public refreshRules(): void {\n this._nodeDefaultStylesRules.refresh();\n this._edgeDefaultStylesRules.refresh();\n }\n\n /**\n * Create / refresh an ogma rule for node colors\n */\n public refreshNodeColors(colorStyleRules: Array<LKStyleRule>): void {\n if (!Tools.isDefined(this._ogmaNodeColor)) {\n this._nodeAttributes.refresh({color: colorStyleRules});\n this._ogmaNodeColor = this._ogma.styles.addRule({\n nodeAttributes: {\n color: (node: o.Node | undefined) => {\n if (node !== undefined) {\n return this._nodeAttributes.color(node.getData());\n }\n }\n },\n nodeDependencies: {self: {data: true}}\n });\n } else {\n this._nodeAttributes.refresh({color: colorStyleRules});\n this._ogmaNodeColor.refresh();\n // TODO refresh node icons when moving the code from LKE\n // this.refreshIconsColor();\n }\n }\n\n /**\n * Return an array of StyleRules with only the style that need to be applied\n */\n public getStyleRule(\n state: Array<IStyleRule<INodeStyle | IEdgeStyle>>,\n styleType: StyleType\n ): LKStyleRule[] {\n return new StyleRules(state)[styleType];\n }\n\n public initNodeColors(nodeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const nodeColorRules = this.getStyleRule(nodeRules, StyleType.COLOR);\n this.refreshNodeColors(nodeColorRules);\n }\n\n public initNodesIcons(nodeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const nodeIconsRules = this.getStyleRule(nodeRules, StyleType.ICON);\n this.refreshNodeIcons(nodeIconsRules);\n }\n\n public initNodesSizes(nodeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const nodeSizeRules = this.getStyleRule(nodeRules, StyleType.SIZE);\n this.refreshNodeSize(nodeSizeRules);\n }\n\n public initNodesShapes(nodeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const nodeShapesRules = this.getStyleRule(nodeRules, StyleType.SHAPE);\n this.refreshNodeShape(nodeShapesRules);\n }\n\n public initEdgesWidth(edgeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const edgesWidthRules = this.getStyleRule(edgeRules, StyleType.WIDTH);\n this.refreshEdgeWidth(edgesWidthRules);\n }\n\n public initEdgesShape(edgeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const edgesShapeRules = this.getStyleRule(edgeRules, StyleType.SHAPE);\n this.refreshEdgeShape(edgesShapeRules);\n }\n\n public initEdgesColor(edgeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const edgesColorRules = this.getStyleRule(edgeRules, StyleType.COLOR);\n this.refreshEdgeColors(edgesColorRules);\n }\n\n /**\n * Create / refresh an ogma rule for node icons\n *\n * @param {Array<any>} iconStyleRules\n */\n public refreshNodeIcons(iconStyleRules: Array<LKStyleRule>): void {\n if (!Tools.isDefined(this._ogmaNodeIcon)) {\n this._nodeAttributes.refresh({icon: iconStyleRules});\n this._ogmaNodeIcon = this._ogma.styles.addRule({\n nodeAttributes: {\n icon: (node: o.Node | undefined) => {\n if (node !== undefined) {\n return this._nodeAttributes.icon(node.getData()).icon;\n }\n },\n image: (node: o.Node | undefined) => {\n if (node !== undefined) {\n return this._nodeAttributes.icon(node.getData()).image;\n }\n }\n },\n nodeDependencies: {self: {data: true}}\n });\n } else {\n this._nodeAttributes.refresh({icon: iconStyleRules});\n this._ogmaNodeIcon.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for node sizes\n *\n * @param {Array<any>} sizeStyleRules\n */\n public refreshNodeSize(sizeStyleRules: Array<LKStyleRule>): void {\n if (!Tools.isDefined(this._ogmaNodeSize)) {\n this._nodeAttributes.refresh({size: sizeStyleRules});\n this._ogmaNodeSize = this._ogma.styles.addRule({\n nodeAttributes: {\n radius: (node: o.Node | undefined) => {\n if (node !== undefined) {\n return this._nodeAttributes.size(node.getData());\n }\n }\n },\n nodeDependencies: {self: {data: true}}\n });\n } else {\n this._nodeAttributes.refresh({size: sizeStyleRules});\n this._ogmaNodeSize.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for node images\n *\n * @param {Array<any>} shapeStyleRules\n */\n public refreshNodeShape(shapeStyleRules: Array<LKStyleRule>): void {\n if (!Tools.isDefined(this._ogmaNodeShape)) {\n this._nodeAttributes.refresh({shape: shapeStyleRules});\n this._ogmaNodeShape = this._ogma.styles.addRule({\n nodeAttributes: {\n shape: (node: o.Node | undefined) => {\n if (node !== undefined) {\n return this._nodeAttributes.shape(node.getData());\n }\n }\n },\n nodeDependencies: {self: {data: true}}\n });\n } else {\n this._nodeAttributes.refresh({shape: shapeStyleRules});\n this._ogmaNodeShape.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for edge colors\n */\n public refreshEdgeColors(colorStyleRules: Array<LKStyleRule>): void {\n if (!Tools.isDefined(this._ogmaEdgeColor)) {\n this._edgeAttributes.refresh({color: colorStyleRules});\n this._ogmaEdgeColor = this._ogma.styles.addRule({\n edgeAttributes: {\n color: (edge: o.Edge | undefined) => {\n if (edge !== undefined) {\n return this._edgeAttributes.color(edge.getData());\n }\n }\n },\n edgeDependencies: {self: {data: true}}\n });\n } else {\n this._edgeAttributes.refresh({color: colorStyleRules});\n this._ogmaEdgeColor.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for edge width\n *\n * @param {Array<LKStyleRule>} widthStyleRules\n */\n public refreshEdgeWidth(widthStyleRules: Array<LKStyleRule>): void {\n if (!Tools.isDefined(this._ogmaEdgeWidth)) {\n this._edgeAttributes.refresh({width: widthStyleRules});\n this._ogmaEdgeWidth = this._ogma.styles.addRule({\n edgeAttributes: {\n width: (edge: o.Edge | undefined) => {\n if (edge !== undefined) {\n return this._edgeAttributes.width(edge.getData());\n }\n }\n },\n edgeDependencies: {\n self: {data: true}\n }\n });\n } else {\n this._edgeAttributes.refresh({width: widthStyleRules});\n this._ogmaEdgeWidth.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for edge width\n *\n * @param {Array<LKStyleRule>} shapeStyleRules\n */\n public refreshEdgeShape(shapeStyleRules: Array<LKStyleRule>): void {\n if (!Tools.isDefined(this._ogmaEdgeShape)) {\n this._edgeAttributes.refresh({shape: shapeStyleRules});\n this._ogmaEdgeShape = this._ogma.styles.addRule({\n edgeAttributes: {\n shape: (edge: o.Edge | undefined) => {\n if (edge !== undefined) {\n return this._edgeAttributes.shape(edge.getData());\n }\n }\n },\n edgeDependencies: {self: {data: true}}\n });\n } else {\n this._edgeAttributes.refresh({shape: shapeStyleRules});\n this._ogmaEdgeShape.refresh();\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/ogma/features/styles.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAsBb,6BASe;AACf,6CAAwC;AAYxC,MAAM,2BAA2B,GAAgD;IAC/E,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,eAAe,EAAE,MAAM;QACvB,cAAc,EAAE,CAAC;KAClB;I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B,EAAE,EAAE;wBAClC,IAAI,IAAI,KAAK,SAAS,EAAE;4BACtB,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;yBACnD;oBACH,CAAC;iBACF;gBACD,gBAAgB,EAAE,EAAC,IAAI,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,EAAC;aACvC,CAAC,CAAC;SACJ;aAAM;YACL,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAC,KAAK,EAAE,eAAe,EAAC,CAAC,CAAC;YACvD,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;SAC/B;IACH,CAAC;CACF;AA9rBD,8BA8rBC","sourcesContent":["'use strict';\n\nimport * as o from '@linkurious/ogma';\nimport {\n Edge,\n EdgeAttributesValue,\n NodeAttributesValue,\n StyleClass,\n StyleRule\n} from '@linkurious/ogma';\nimport {\n GenericObject,\n IEdgeStyle,\n INodeStyle,\n IStyleRule,\n LkEdgeData,\n LkNodeData,\n OgmaEdgeShape,\n OgmaNodeShape,\n TextOptions\n} from '@linkurious/rest-client';\n\nimport {\n BASE_GREY,\n EdgeAttributes,\n LKOgma,\n NodeAttributes,\n OgmaTools,\n StyleRule as LKStyleRule,\n StyleRules,\n StyleType\n} from '../..';\nimport {Tools} from '../../tools/tools';\n\nexport interface StylesConfig {\n nodeColorStyleRules: Array<LKStyleRule>;\n nodeIconStyleRules: Array<LKStyleRule>;\n nodeSizeStyleRules: Array<LKStyleRule>;\n nodeShapeStyleRules?: Array<LKStyleRule>;\n edgeColorStyleRules: Array<LKStyleRule>;\n edgeWidthStyleRules: Array<LKStyleRule>;\n edgeShapeStyleRules?: Array<LKStyleRule>;\n}\n\nconst HOVERED_SELECTED_NODE_STYLE: NodeAttributesValue<LkNodeData, LkEdgeData> = {\n text: {\n style: 'bold',\n backgroundColor: '#fff',\n minVisibleSize: 0\n },\n outerStroke: {width: 2},\n outline: false\n};\n\nconst HOVERED_SELECTED_EDGE_STYLE: EdgeAttributesValue<LkEdgeData, LkNodeData> = {\n text: {\n style: 'bold',\n backgroundColor: '#fff',\n minVisibleSize: 0\n },\n outline: false\n};\n\nconst NODE_HALO_CONFIGURATION = {\n color: '#FFF',\n width: 7,\n scalingMethod: 'scaled',\n strokeWidth: 0,\n hideNonAdjacentEdges: false\n} as {\n color: '#FFF';\n width: 7;\n strokeWidth: 0;\n};\n\nconst EDGE_HALO_CONFIGURATION = {\n color: '#FFF',\n scalingMethod: 'scaled',\n width: 4\n} as {\n color: '#FFF';\n width: 4;\n};\n\nconst DEFAULT_OGMA_FONT = \"'roboto', sans-serif\";\nconst DARK_FONT_COLOR = '#000';\nconst CLEAR_FONT_COLOR = '#FFF';\nconst ITEM_DEFAULT_COLOR = '#7f7f7f';\nexport const FILTER_OPACITY = 0.2;\n\nexport class StylesViz {\n private _ogma: LKOgma;\n private _exportClass!: StyleClass;\n private _nodeDefaultStylesRules!: StyleRule<LkNodeData, LkEdgeData>;\n // @ts-ignore\n private _nodeDefaultHaloRules!: StyleRule<LkNodeData, LkEdgeData>;\n private _edgeDefaultStylesRules!: StyleRule<LkNodeData, LkEdgeData>;\n // @ts-ignore\n private _edgeDefaultHaloRules!: StyleRule<LkNodeData, LkEdgeData>;\n\n private _nodeAttributes: NodeAttributes = new NodeAttributes({});\n private _edgeAttributes: EdgeAttributes = new EdgeAttributes({});\n\n private _ogmaNodeColor!: StyleRule;\n private _ogmaNodeIcon!: StyleRule;\n private _ogmaNodeSize!: StyleRule;\n private _ogmaNodeShape!: StyleRule;\n private _ogmaEdgeColor!: StyleRule;\n private _ogmaEdgeWidth!: StyleRule;\n private _ogmaEdgeShape!: StyleRule;\n private _defaultConfiguration: {\n node: {\n nodeRadius?: number;\n shape?: OgmaNodeShape;\n text?: TextOptions & {\n nodePosition?: 'right' | 'left' | 'top' | 'bottom' | 'center';\n };\n };\n edge: {\n edgeWidth?: number;\n shape?: OgmaEdgeShape;\n text?: TextOptions;\n };\n };\n\n constructor(\n ogma: LKOgma,\n configuration: {\n node: {\n nodeRadius?: number;\n shape?: OgmaNodeShape;\n text?: TextOptions & {\n nodePosition?: 'right' | 'left' | 'top' | 'bottom' | 'center';\n };\n };\n edge: {\n edgeWidth?: number;\n shape?: OgmaEdgeShape;\n text?: TextOptions;\n };\n }\n ) {\n this._ogma = ogma;\n this._defaultConfiguration = configuration;\n }\n\n /**\n * Set nodes default styles based on the configuration\n */\n public setNodesDefaultStyles(): void {\n // setting selection and hover attributes\n this._ogma.styles.setHoveredNodeAttributes(HOVERED_SELECTED_NODE_STYLE);\n this._ogma.styles.setSelectedNodeAttributes(HOVERED_SELECTED_NODE_STYLE);\n // setting default styles\n this._nodeDefaultStylesRules = this._ogma.styles.addRule({\n nodeAttributes: {\n text: {\n padding: 5,\n minVisibleSize:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.minVisibleSize\n ? this._defaultConfiguration.node.text.minVisibleSize\n : 12,\n maxLineLength:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.maxLineLength !== undefined\n ? this._defaultConfiguration.node.text.maxLineLength\n : 30,\n position:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.nodePosition !== undefined\n ? this._defaultConfiguration.node.text.nodePosition\n : 'bottom',\n backgroundColor:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.backgroundColor !== undefined\n ? this._defaultConfiguration.node.text.backgroundColor\n : 'null',\n font:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.font !== undefined\n ? this._defaultConfiguration.node.text.font\n : \"'roboto', sans-serif\",\n color:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.color !== undefined\n ? this._defaultConfiguration.node.text.color\n : 'black',\n size:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.size !== undefined\n ? this._defaultConfiguration.node.text.size\n : 14,\n margin: 5\n },\n radius: this.defaultNodeRadius(this._defaultConfiguration.node),\n icon: {\n minVisibleSize: 15\n },\n color: ITEM_DEFAULT_COLOR,\n shape:\n this._defaultConfiguration.node.shape !== undefined\n ? this._defaultConfiguration.node.shape\n : ('circle' as OgmaNodeShape),\n innerStroke: {\n width: 3\n },\n outline: false\n }\n });\n }\n\n /**\n * Set edges default styles based on the configuration\n */\n public setEdgesDefaultStyles(): void {\n // setting selection and hover attributes\n this._ogma.styles.setHoveredEdgeAttributes(HOVERED_SELECTED_EDGE_STYLE);\n this._ogma.styles.setSelectedEdgeAttributes(HOVERED_SELECTED_EDGE_STYLE);\n // setting default styles\n this._edgeDefaultStylesRules = this._ogma.styles.addRule({\n edgeAttributes: {\n text: {\n minVisibleSize:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.minVisibleSize\n ? this._defaultConfiguration.edge.text.minVisibleSize\n : 3,\n maxLineLength:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.maxLineLength !== undefined\n ? this._defaultConfiguration.edge.text.maxLineLength\n : 30,\n backgroundColor:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.backgroundColor !== undefined\n ? this._defaultConfiguration.edge.text.backgroundColor\n : null,\n font:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.font !== undefined\n ? this._defaultConfiguration.edge.text.font\n : \"'roboto', sans-serif\",\n color:\n this._defaultConfiguration.edge !== undefined &&\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.color !== undefined\n ? this._defaultConfiguration.edge.text.color\n : 'black',\n size:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.size !== undefined\n ? this._defaultConfiguration.edge.text.size\n : 14\n },\n width: this.defaultEdgeWidth(this._defaultConfiguration.edge),\n shape:\n this._defaultConfiguration.edge.shape !== undefined\n ? this._defaultConfiguration.edge.shape\n : 'arrow',\n color: ITEM_DEFAULT_COLOR\n }\n });\n }\n\n /**\n * Set nodes default styles based on the configuration\n */\n public setNodesDefaultHalo(): void {\n // setting default halo style\n this._nodeDefaultHaloRules = this._ogma.styles.addRule({\n nodeSelector: (node) => node && !node.hasClass('filtered'),\n nodeAttributes: {\n halo: (node) => {\n if (\n node !== undefined &&\n !node.hasClass('filtered') &&\n (node.isSelected() ||\n node.getAdjacentNodes({}).isSelected().includes(true) ||\n node.getAdjacentEdges().isSelected().includes(true))\n ) {\n return {\n ...NODE_HALO_CONFIGURATION,\n scalingMethod: this._ogma.geo.enabled() ? 'fixed' : 'scaled'\n };\n }\n return null;\n }\n },\n // recalculate the rule *only* when itself or adjacent\n // elements change their selection status\n nodeDependencies: {\n self: {\n selection: true\n },\n adjacentNodes: {\n selection: true\n },\n adjacentEdges: {\n selection: true\n }\n }\n });\n }\n\n /**\n * Set edges default styles based on the configuration\n */\n public setEdgesDefaultHalo(): void {\n // setting default halo styles\n this._edgeDefaultHaloRules = this._ogma.styles.addRule({\n edgeSelector: (edge: Edge) =>\n edge && edge.getSource() && edge.getTarget() && !edge.hasClass('filtered'),\n edgeAttributes: {\n halo: (edge) => {\n if (\n edge &&\n !edge.hasClass('filtered') &&\n (edge.isSelected() || edge.getSource().isSelected() || edge.getTarget().isSelected())\n ) {\n return {\n ...EDGE_HALO_CONFIGURATION,\n scalingMethod: this._ogma.geo.enabled() ? 'fixed' : 'scaled'\n };\n }\n return null;\n }\n },\n // this rule will only be invoked when the selection status\n // of the edge or it's extremities is changed\n edgeDependencies: {\n self: {\n selection: true\n },\n extremities: {\n selection: true\n }\n }\n });\n }\n\n /**\n * Return the default node radius set in configuration or 5\n *\n * @returns {number}\n */\n private defaultNodeRadius(styles: any): number {\n return this.defaultStylesHas(styles, ['nodeRadius']) ? styles.nodeRadius : 5;\n }\n\n /**\n * Return the default edge width set in configuration or 1\n *\n * @returns {number}\n */\n private defaultEdgeWidth(styles: any): number {\n return this.defaultStylesHas(styles, ['edgeWidth']) ? styles.edgeWidth : 1;\n }\n\n /**\n * Check if a style property exists in the default styles object\n */\n private defaultStylesHas(styles: GenericObject<unknown>, propertyPath: Array<string>): boolean {\n if (!Tools.isDefined(styles)) {\n return false;\n }\n return Tools.getIn(styles, propertyPath) !== undefined;\n }\n\n /**\n * Set styles for the class \"filtered\"\n */\n public setFilterClass(): void {\n this._ogma.styles.createClass({\n name: 'filtered',\n nodeAttributes: {\n opacity: FILTER_OPACITY,\n layer: -1,\n detectable: false,\n badges: {\n topRight: {\n text: null\n },\n bottomRight: {\n text: null\n }\n },\n text: null,\n color: 'rgb(240, 240, 240)',\n innerStroke: {\n width: 1,\n color: BASE_GREY,\n minVisibleSize: 1\n },\n shape: 'circle',\n image: null,\n icon: null,\n radius: '100%'\n },\n edgeAttributes: {\n opacity: FILTER_OPACITY,\n layer: -1,\n detectable: false,\n text: null,\n color: BASE_GREY,\n shape: 'line',\n width: 0.2\n }\n });\n }\n\n /**\n * Set the class for exported nodes and edges\n */\n public setExportClass(textWrappingLength?: boolean): void {\n if (!this._exportClass) {\n this._exportClass = this._ogma.styles.createClass({\n name: 'exported',\n nodeAttributes: {\n text: {\n minVisibleSize: 0,\n size: 12,\n maxLineLength: textWrappingLength ? 30 : 0\n },\n halo: null\n },\n edgeAttributes: {\n text: {\n minVisibleSize: 0,\n size: 12\n },\n halo: null\n }\n });\n } else {\n this._exportClass.update({\n nodeAttributes: {\n text: {\n maxLineLength: textWrappingLength ? 30 : 0\n },\n halo: null\n }\n });\n }\n }\n\n /**\n * Set the rule to display badges\n */\n public setBadgeRule() {\n this._ogma.styles.createClass({\n name: 'degreeIndicator',\n nodeAttributes: {\n badges: {\n topRight: (node) => {\n if (node !== undefined) {\n const degree = Tools.getHiddenNeighbors(node.toList());\n const badgeContent = Tools.formatNumber(degree);\n if (degree > 0) {\n const nodeColor = Array.isArray(node.getAttribute('color'))\n ? node.getAttribute('color')![0]\n : node.getAttribute('color');\n const textColor = OgmaTools.isBright(nodeColor as o.Color)\n ? DARK_FONT_COLOR\n : CLEAR_FONT_COLOR;\n const isSupernode = node.getData(['statistics', 'supernode']);\n let content = null;\n if (+badgeContent !== 0) {\n content = isSupernode ? badgeContent + '+' : badgeContent;\n }\n return {\n color: 'inherit',\n minVisibleSize: 20,\n stroke: {\n width: 0,\n color: null\n },\n text: {\n font:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.font !== undefined\n ? this._defaultConfiguration.node.text.font\n : DEFAULT_OGMA_FONT,\n scale: 0.4,\n color: textColor,\n content: content\n }\n };\n }\n }\n }\n }\n }\n });\n this._ogma.styles.createClass({\n name: 'pinnedIndicator',\n nodeAttributes: {\n badges: {\n bottomRight: (node) => {\n if (node !== undefined && !node.getAttribute('layoutable')) {\n const nodeColor = Array.isArray(node.getAttribute('color'))\n ? node.getAttribute('color')![0]\n : node.getAttribute('color');\n const textColor = OgmaTools.isBright(nodeColor as o.Color)\n ? DARK_FONT_COLOR\n : CLEAR_FONT_COLOR;\n return {\n color: 'inherit',\n minVisibleSize: 20,\n stroke: {\n width: 0,\n color: null\n },\n text: {\n font: 'FontAwesome',\n scale: 0.4,\n color: textColor,\n content: node.getAttribute('layoutable') ? null : '\\uf08d'\n }\n };\n }\n }\n }\n },\n nodeDependencies: {\n self: {attributes: ['layoutable']}\n }\n });\n this._ogma.events.on('addNodes', (nodesEvent) => nodesEvent.nodes.addClass('degreeIndicator'));\n this._ogma.events.on('addNodes', (nodesEvent) => nodesEvent.nodes.addClass('pinnedIndicator'));\n }\n\n /**\n * Delete the rule to display badges\n */\n public deleteBadgeRule() {\n this._ogma.getNodes().removeClasses(['degreeIndicator', 'pinnedIndicator'], 0);\n }\n\n /**\n * set text overlap to true or false\n *\n * @param {boolean} overlap\n */\n public toggleTextOverlap(overlap?: boolean): void {\n this._ogma.setOptions({texts: {preventOverlap: overlap}});\n }\n\n /**\n * refresh nodes and edge rules\n *\n */\n public refreshRules(): void {\n this._nodeDefaultStylesRules.refresh();\n this._edgeDefaultStylesRules.refresh();\n }\n\n /**\n * Create / refresh an ogma rule for node colors\n */\n public refreshNodeColors(colorStyleRules: Array<LKStyleRule<INodeStyle>>): void {\n if (!Tools.isDefined(this._ogmaNodeColor)) {\n this._nodeAttributes.refresh({color: colorStyleRules});\n this._ogmaNodeColor = this._ogma.styles.addRule({\n nodeAttributes: {\n color: (node: o.Node | undefined) => {\n if (node !== undefined) {\n return this._nodeAttributes.color(node.getData());\n }\n }\n },\n nodeDependencies: {self: {data: true}}\n });\n } else {\n this._nodeAttributes.refresh({color: colorStyleRules});\n this._ogmaNodeColor.refresh();\n // TODO refresh node icons when moving the code from LKE\n // this.refreshIconsColor();\n }\n }\n\n /**\n * Return an array of StyleRules with only the style that need to be applied\n */\n public getStyleRule(\n state: Array<IStyleRule<INodeStyle | IEdgeStyle>>,\n styleType: StyleType\n ): LKStyleRule[] {\n return new StyleRules(state)[styleType];\n }\n\n public initNodeColors(nodeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>): void {\n const nodeColorRules = this.getStyleRule(\n nodeRules,\n StyleType.COLOR\n ) as LKStyleRule<INodeStyle>[];\n this.refreshNodeColors(nodeColorRules);\n }\n\n public initNodesIcons(nodeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const nodeIconsRules = this.getStyleRule(\n nodeRules,\n StyleType.ICON\n ) as LKStyleRule<INodeStyle>[];\n this.refreshNodeIcons(nodeIconsRules);\n }\n\n public initNodesSizes(nodeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const nodeSizeRules = this.getStyleRule(nodeRules, StyleType.SIZE) as LKStyleRule<INodeStyle>[];\n this.refreshNodeSize(nodeSizeRules);\n }\n\n public initNodesShapes(nodeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const nodeShapesRules = this.getStyleRule(\n nodeRules,\n StyleType.SHAPE\n ) as LKStyleRule<INodeStyle>[];\n this.refreshNodeShape(nodeShapesRules);\n }\n\n public initEdgesWidth(edgeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const edgesWidthRules = this.getStyleRule(\n edgeRules,\n StyleType.WIDTH\n ) as LKStyleRule<IEdgeStyle>[];\n this.refreshEdgeWidth(edgesWidthRules);\n }\n\n public initEdgesShape(edgeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const edgesShapeRules = this.getStyleRule(\n edgeRules,\n StyleType.SHAPE\n ) as LKStyleRule<IEdgeStyle>[];\n this.refreshEdgeShape(edgesShapeRules);\n }\n\n public initEdgesColor(edgeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const edgesColorRules = this.getStyleRule(\n edgeRules,\n StyleType.COLOR\n ) as LKStyleRule<IEdgeStyle>[];\n this.refreshEdgeColors(edgesColorRules);\n }\n\n /**\n * Create / refresh an ogma rule for node icons\n *\n * @param {Array<any>} iconStyleRules\n */\n public refreshNodeIcons(iconStyleRules: Array<LKStyleRule<INodeStyle>>): void {\n if (!Tools.isDefined(this._ogmaNodeIcon)) {\n this._nodeAttributes.refresh({icon: iconStyleRules});\n this._ogmaNodeIcon = this._ogma.styles.addRule({\n nodeAttributes: {\n icon: (node: o.Node | undefined) => {\n if (node !== undefined) {\n return this._nodeAttributes.icon(node.getData()).icon;\n }\n },\n image: (node: o.Node | undefined) => {\n if (node !== undefined) {\n return this._nodeAttributes.icon(node.getData()).image;\n }\n }\n },\n nodeDependencies: {self: {data: true}}\n });\n } else {\n this._nodeAttributes.refresh({icon: iconStyleRules});\n this._ogmaNodeIcon.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for node sizes\n *\n * @param {Array<any>} sizeStyleRules\n */\n public refreshNodeSize(sizeStyleRules: Array<LKStyleRule<INodeStyle>>): void {\n if (!Tools.isDefined(this._ogmaNodeSize)) {\n this._nodeAttributes.refresh({size: sizeStyleRules});\n this._ogmaNodeSize = this._ogma.styles.addRule({\n nodeAttributes: {\n radius: (node: o.Node | undefined) => {\n if (node !== undefined) {\n return this._nodeAttributes.size(node.getData());\n }\n }\n },\n nodeDependencies: {self: {data: true}}\n });\n } else {\n this._nodeAttributes.refresh({size: sizeStyleRules});\n this._ogmaNodeSize.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for node images\n *\n * @param {Array<any>} shapeStyleRules\n */\n public refreshNodeShape(shapeStyleRules: Array<LKStyleRule<INodeStyle>>): void {\n if (!Tools.isDefined(this._ogmaNodeShape)) {\n this._nodeAttributes.refresh({shape: shapeStyleRules});\n this._ogmaNodeShape = this._ogma.styles.addRule({\n nodeAttributes: {\n shape: (node: o.Node | undefined) => {\n if (node !== undefined) {\n return this._nodeAttributes.shape(node.getData());\n }\n }\n },\n nodeDependencies: {self: {data: true}}\n });\n } else {\n this._nodeAttributes.refresh({shape: shapeStyleRules});\n this._ogmaNodeShape.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for edge colors\n */\n public refreshEdgeColors(colorStyleRules: Array<LKStyleRule<IEdgeStyle>>): void {\n if (!Tools.isDefined(this._ogmaEdgeColor)) {\n this._edgeAttributes.refresh({color: colorStyleRules});\n this._ogmaEdgeColor = this._ogma.styles.addRule({\n edgeAttributes: {\n color: (edge: o.Edge | undefined) => {\n if (edge !== undefined) {\n return this._edgeAttributes.color(edge.getData());\n }\n }\n },\n edgeDependencies: {self: {data: true}}\n });\n } else {\n this._edgeAttributes.refresh({color: colorStyleRules});\n this._ogmaEdgeColor.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for edge width\n *\n * @param {Array<LKStyleRule>} widthStyleRules\n */\n public refreshEdgeWidth(widthStyleRules: Array<LKStyleRule<IEdgeStyle>>): void {\n if (!Tools.isDefined(this._ogmaEdgeWidth)) {\n this._edgeAttributes.refresh({width: widthStyleRules});\n this._ogmaEdgeWidth = this._ogma.styles.addRule({\n edgeAttributes: {\n width: (edge: o.Edge | undefined) => {\n if (edge !== undefined) {\n return this._edgeAttributes.width(edge.getData());\n }\n }\n },\n edgeDependencies: {\n self: {data: true}\n }\n });\n } else {\n this._edgeAttributes.refresh({width: widthStyleRules});\n this._ogmaEdgeWidth.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for edge width\n *\n * @param {Array<LKStyleRule>} shapeStyleRules\n */\n public refreshEdgeShape(shapeStyleRules: Array<LKStyleRule<IEdgeStyle>>): void {\n if (!Tools.isDefined(this._ogmaEdgeShape)) {\n this._edgeAttributes.refresh({shape: shapeStyleRules});\n this._ogmaEdgeShape = this._ogma.styles.addRule({\n edgeAttributes: {\n shape: (edge: o.Edge | undefined) => {\n if (edge !== undefined) {\n return this._edgeAttributes.shape(edge.getData());\n }\n }\n },\n edgeDependencies: {self: {data: true}}\n });\n } else {\n this._edgeAttributes.refresh({shape: shapeStyleRules});\n this._ogmaEdgeShape.refresh();\n }\n }\n}\n"]}
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TransformationsViz = void 0;
|
|
12
13
|
const DEFAULT_EDGE_GROUP_STYLE = {
|
|
13
14
|
color: '#000000',
|
|
14
15
|
shape: {
|
|
@@ -46,7 +47,7 @@ class TransformationsViz {
|
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
49
|
else {
|
|
49
|
-
this.transformation.refresh();
|
|
50
|
+
yield this.transformation.refresh();
|
|
50
51
|
}
|
|
51
52
|
});
|
|
52
53
|
}
|
|
@@ -54,22 +55,20 @@ class TransformationsViz {
|
|
|
54
55
|
* init edge grouping style
|
|
55
56
|
*/
|
|
56
57
|
initEdgeGroupingStyle() {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
edgeDependencies: { self: { data: true } }
|
|
72
|
-
});
|
|
58
|
+
this.edgeGroupingStyleRule = this._ogma.styles.addRule({
|
|
59
|
+
edgeAttributes: Object.assign(Object.assign(Object.assign({}, DEFAULT_EDGE_GROUP_STYLE), this.edgeGroupStyle), { text: {
|
|
60
|
+
content: (edge) => {
|
|
61
|
+
if (edge !== undefined && edge.getSubEdges() !== null) {
|
|
62
|
+
const size = edge.getSubEdges().filter((e) => !e.hasClass('filtered')).size;
|
|
63
|
+
return `${edge.getData(['properties', 'originalType'])} - ${size}`;
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
style: 'bold'
|
|
67
|
+
} }),
|
|
68
|
+
edgeSelector: (edge) => edge.isVirtual() &&
|
|
69
|
+
edge.getSubEdges() &&
|
|
70
|
+
edge.getSubEdges().filter((e) => !e.hasClass('filtered')).size > 0,
|
|
71
|
+
edgeDependencies: { self: { data: true } }
|
|
73
72
|
});
|
|
74
73
|
}
|
|
75
74
|
refreshEdgeGroupingStyle() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformations.js","sourceRoot":"","sources":["../../../src/ogma/features/transformations.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"transformations.js","sourceRoot":"","sources":["../../../src/ogma/features/transformations.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;AAeb,MAAM,wBAAwB,GAS1B;IACF,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE;QACL,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,OAAO;KACd;IACD,KAAK,EAAE,GAAG;CACX,CAAC;AAEF,MAAa,kBAAkB;IAO7B,YAAY,IAAY;QACtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;IACzB,CAAC;IAED;;OAEG;IACU,kBAAkB;;YAC7B,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS,EAAE;gBACrC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CA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AAC,IAAI,EAAE,EAAE,CACrB,IAAI,CAAC,SAAS,EAAE;gBAChB,IAAI,CAAC,WAAW,EAAE;gBAClB,IAAI,CAAC,WAAW,EAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;YACrE,gBAAgB,EAAE,EAAC,IAAI,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,EAAC;SACvC,CAAC,CAAC;IACL,CAAC;IAEM,wBAAwB;QAC7B,IAAI,IAAI,CAAC,qBAAqB,KAAK,SAAS,EAAE;YAC5C,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,CAAC;SACtC;IACH,CAAC;CACF;AArED,gDAqEC","sourcesContent":["'use strict';\n\nimport {GenericObject, IEdgeGroupStyle, LkEdgeData, LkNodeData} from '@linkurious/rest-client';\nimport {\n Edge,\n EdgeExtremity,\n EdgeStyle,\n EdgeType,\n PixelSize,\n StyleRule,\n Transformation\n} from '@linkurious/ogma';\n\nimport {LKOgma} from '../index';\n\nconst DEFAULT_EDGE_GROUP_STYLE: {\n color: string;\n shape: {\n body?: EdgeType;\n head?: EdgeExtremity;\n tail?: EdgeExtremity;\n style?: EdgeStyle;\n };\n width: PixelSize;\n} = {\n color: '#000000',\n shape: {\n style: 'dashed',\n head: 'arrow'\n },\n width: 1.5\n};\n\nexport class TransformationsViz {\n private _ogma: LKOgma;\n public groupedEdges: GenericObject<boolean>;\n public edgeGroupStyle!: IEdgeGroupStyle;\n public transformation!: Transformation<LkNodeData, LkEdgeData>;\n public edgeGroupingStyleRule!: StyleRule<LkNodeData, LkEdgeData>;\n\n constructor(ogma: LKOgma) {\n this._ogma = ogma;\n this.groupedEdges = {};\n }\n\n /**\n * create an edge grouping transformation by edge type\n */\n public async initTransformation(): Promise<void> {\n if (this.transformation === undefined) {\n this.transformation = this._ogma.transformations.addEdgeGrouping({\n separateEdgesByDirection: true,\n selector: (edge) => {\n return this.groupedEdges[edge.getData('type')];\n },\n groupIdFunction: (edge) => edge.getData('type'),\n generator: (edges) => {\n return {\n data: {\n properties: {\n originalType: edges.getData('type')[0]\n }\n }\n };\n }\n });\n } else {\n await this.transformation.refresh();\n }\n }\n\n /**\n * init edge grouping style\n */\n public initEdgeGroupingStyle(): void {\n this.edgeGroupingStyleRule = this._ogma.styles.addRule({\n edgeAttributes: {\n ...DEFAULT_EDGE_GROUP_STYLE,\n ...(this.edgeGroupStyle as any),\n text: {\n content: (edge: Edge<LkEdgeData> | undefined) => {\n if (edge !== undefined && edge.getSubEdges() !== null) {\n const size = edge.getSubEdges()!.filter((e) => !e.hasClass('filtered')).size;\n return `${edge.getData(['properties', 'originalType'])} - ${size}`;\n }\n },\n style: 'bold'\n }\n },\n edgeSelector: (edge) =>\n edge.isVirtual() &&\n edge.getSubEdges() &&\n edge.getSubEdges()!.filter((e) => !e.hasClass('filtered')).size > 0,\n edgeDependencies: {self: {data: true}}\n });\n }\n\n public refreshEdgeGroupingStyle(): void {\n if (this.edgeGroupingStyleRule !== undefined) {\n this.edgeGroupingStyleRule.refresh();\n }\n }\n}\n"]}
|
package/dist/ogma/index.js
CHANGED
|
@@ -12,6 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.LKOgma = exports.ANIMATION_DURATION = exports.Ogma = void 0;
|
|
15
16
|
const rest_client_1 = require("@linkurious/rest-client");
|
|
16
17
|
const ogma_1 = __importDefault(require("@linkurious/ogma"));
|
|
17
18
|
const __1 = require("..");
|
|
@@ -21,7 +22,7 @@ const transformations_1 = require("./features/transformations");
|
|
|
21
22
|
const captions_1 = require("./features/captions");
|
|
22
23
|
const reactive_1 = require("./features/reactive");
|
|
23
24
|
var ogma_2 = require("@linkurious/ogma");
|
|
24
|
-
exports
|
|
25
|
+
Object.defineProperty(exports, "Ogma", { enumerable: true, get: function () { return __importDefault(ogma_2).default; } });
|
|
25
26
|
exports.ANIMATION_DURATION = 750;
|
|
26
27
|
class LKOgma extends ogma_1.default {
|
|
27
28
|
constructor(_configuration) {
|
|
@@ -107,18 +108,18 @@ class LKOgma extends ogma_1.default {
|
|
|
107
108
|
});
|
|
108
109
|
}
|
|
109
110
|
setStyles(configuration) {
|
|
110
|
-
var _a, _b, _c, _d
|
|
111
|
+
var _a, _b, _c, _d;
|
|
111
112
|
this.LKStyles = new styles_1.StylesViz(this, {
|
|
112
|
-
node: ((
|
|
113
|
-
edge: ((
|
|
113
|
+
node: ((_b = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.options) === null || _a === void 0 ? void 0 : _a.styles) === null || _b === void 0 ? void 0 : _b.node) || {},
|
|
114
|
+
edge: ((_d = (_c = configuration === null || configuration === void 0 ? void 0 : configuration.options) === null || _c === void 0 ? void 0 : _c.styles) === null || _d === void 0 ? void 0 : _d.edge) || {}
|
|
114
115
|
});
|
|
115
116
|
this.LKStyles.setNodesDefaultStyles();
|
|
116
117
|
this.LKStyles.setEdgesDefaultStyles();
|
|
117
118
|
}
|
|
118
119
|
setCaptions(configuration) {
|
|
119
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
120
|
-
const nodeMaxTextLength = (
|
|
121
|
-
const edgeMaxTextLength = (
|
|
120
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
121
|
+
const nodeMaxTextLength = (_d = (_c = (_b = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.options) === null || _a === void 0 ? void 0 : _a.styles) === null || _b === void 0 ? void 0 : _b.node) === null || _c === void 0 ? void 0 : _c.text) === null || _d === void 0 ? void 0 : _d.maxTextLength;
|
|
122
|
+
const edgeMaxTextLength = (_h = (_g = (_f = (_e = configuration === null || configuration === void 0 ? void 0 : configuration.options) === null || _e === void 0 ? void 0 : _e.styles) === null || _f === void 0 ? void 0 : _f.edge) === null || _g === void 0 ? void 0 : _g.text) === null || _h === void 0 ? void 0 : _h.maxTextLength;
|
|
122
123
|
this.LKCaptions = new captions_1.CaptionsViz(this, nodeMaxTextLength, edgeMaxTextLength);
|
|
123
124
|
}
|
|
124
125
|
/**
|
|
@@ -199,7 +200,7 @@ class LKOgma extends ogma_1.default {
|
|
|
199
200
|
}
|
|
200
201
|
initVisualization(visualization) {
|
|
201
202
|
return __awaiter(this, void 0, void 0, function* () {
|
|
202
|
-
this.init(visualization);
|
|
203
|
+
yield this.init(visualization);
|
|
203
204
|
const styles = __1.StyleRules.sanitizeStylesIndex(visualization.design.styles);
|
|
204
205
|
this.LKStyles.initNodeColors(styles.node);
|
|
205
206
|
this.LKStyles.initNodesIcons(styles.node);
|
|
@@ -208,12 +209,12 @@ class LKOgma extends ogma_1.default {
|
|
|
208
209
|
this.LKStyles.initEdgesWidth(styles.edge);
|
|
209
210
|
this.LKStyles.initEdgesShape(styles.edge);
|
|
210
211
|
this.LKStyles.initEdgesColor(styles.edge);
|
|
211
|
-
this.LKCaptions.initVizCaptions({
|
|
212
|
+
yield this.LKCaptions.initVizCaptions({
|
|
212
213
|
node: visualization.nodeFields.captions || {},
|
|
213
214
|
edge: visualization.edgeFields.captions || {}
|
|
214
215
|
});
|
|
215
216
|
this.LKTransformation.groupedEdges = visualization.edgeGrouping;
|
|
216
|
-
this.LKTransformation.initTransformation();
|
|
217
|
+
yield this.LKTransformation.initTransformation();
|
|
217
218
|
this.LKTransformation.initEdgeGroupingStyle();
|
|
218
219
|
});
|
|
219
220
|
}
|
|
@@ -234,15 +235,10 @@ class LKOgma extends ogma_1.default {
|
|
|
234
235
|
* Adding edges to the graph after filtering disconnected ones
|
|
235
236
|
*/
|
|
236
237
|
addEdges(edges, options) {
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
});
|
|
240
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
241
|
-
const filteredEdges = edges.filter((edge) => {
|
|
242
|
-
return this.getNode(edge.source) !== undefined && this.getNode(edge.target) !== undefined;
|
|
243
|
-
});
|
|
244
|
-
return _super.addEdges.call(this, filteredEdges, options);
|
|
238
|
+
const filteredEdges = edges.filter((edge) => {
|
|
239
|
+
return this.getNode(edge.source) !== undefined && this.getNode(edge.target) !== undefined;
|
|
245
240
|
});
|
|
241
|
+
return super.addEdges(filteredEdges, options);
|
|
246
242
|
}
|
|
247
243
|
/**
|
|
248
244
|
* Return the list of non filtered nodes
|
package/dist/ogma/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ogma/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,yDAUiC;AACjC,4DAU0B;AAE1B,0BAA8B;AAC9B,0CAAqC;AAErC,8CAA4C;AAC5C,gEAA8D;AAC9D,kDAAgD;AAChD,kDAA0C;AAG1C,yCAAiD;AAAzC,sBAAA,OAAO,CAAQ;AACV,QAAA,kBAAkB,GAAG,GAAG,CAAC;AAOtC,MAAa,MAAO,SAAQ,cAA4B;IAWtD,YAAoB,cAA2B;QAC7C,gCAAgC;QAChC,KAAK,CAAC,cAAc,CAAC,CAAC;QAFJ,mBAAc,GAAd,cAAc,CAAa;QAG7C,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAEO,wBAAwB,CAAC,IAAc;QAC7C,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC;YAClE,IAAI,EAAE,YAAY;YAClB,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QACH,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC;YAC5D,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,KAAK;SACd,CAAC,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TD,wBA8TC","sourcesContent":["import {\n EntityType,\n ForceLayoutMode,\n HierarchicalLayoutMode,\n IOgmaConfig,\n LkEdgeData,\n LkNodeData,\n PopulatedVisualization,\n VizEdge,\n VizNode\n} from '@linkurious/rest-client';\nimport Ogma, {\n EdgeList,\n ForceLayoutOptions,\n HierarchicalLayoutOptions,\n NodeList,\n NonObjectPropertyWatcher,\n RadialLayoutOptions,\n RawEdge,\n RawGraph,\n RawNode\n} from '@linkurious/ogma';\n\nimport {StyleRules} from '..';\nimport {Tools} from '../tools/tools';\n\nimport {StylesViz} from './features/styles';\nimport {TransformationsViz} from './features/transformations';\nimport {CaptionsViz} from './features/captions';\nimport {RxViz} from './features/reactive';\nimport {OgmaStore} from './features/OgmaStore';\n\nexport {default as Ogma} from '@linkurious/ogma';\nexport const ANIMATION_DURATION = 750;\n\ninterface AddItemOptions {\n batchSize?: number;\n virtual?: boolean;\n}\n\nexport class LKOgma extends Ogma<LkNodeData, LkEdgeData> {\n public LKStyles!: StylesViz;\n public LKCaptions!: CaptionsViz;\n public LKTransformation!: TransformationsViz;\n // Trigger an event with node category changes\n public nodeCategoriesWatcher!: NonObjectPropertyWatcher<LkNodeData, LkEdgeData>;\n // Trigger an event with edge type changes\n public edgeTypeWatcher!: NonObjectPropertyWatcher<LkNodeData, LkEdgeData>;\n public store!: OgmaStore;\n private _reactive!: RxViz;\n\n constructor(private _configuration: IOgmaConfig) {\n // set Ogma global configuration\n super(_configuration);\n Object.setPrototypeOf(this, new.target.prototype);\n this.initOgmaLinkuriousParser(true);\n }\n\n private initOgmaLinkuriousParser(init?: boolean): void {\n this.nodeCategoriesWatcher = this.schema.watchNodeNonObjectProperty({\n path: 'categories',\n unwindArrays: true,\n filter: 'all'\n });\n this.edgeTypeWatcher = this.schema.watchEdgeNonObjectProperty({\n path: 'type',\n filter: 'all'\n });\n // set ogma max zoom value and selection with mouse option (false?)\n this.setOptions({\n interactions: {\n zoom: {\n maxValue: (params: any) => {\n return 128 / params.smallestNodeSize;\n }\n },\n selection: {\n enabled: false\n }\n }\n });\n\n // only instantiate the store once when app is starting\n if (this._reactive === undefined) {\n this._reactive = new RxViz(this);\n this.store = this._reactive.store;\n } else {\n // if store already exist, but ogma was reset, create new ogma event listener\n this._reactive.listenToSelectionEvents();\n }\n this.initSelection();\n this.setConfigOgma(this._configuration, init);\n this.LKTransformation = new TransformationsViz(this);\n\n this.LKStyles.setNodesDefaultHalo();\n this.LKStyles.setEdgesDefaultHalo();\n this.LKStyles.setBadgeRule();\n this.LKStyles.setFilterClass();\n }\n\n /**\n * Initialize selection behavior\n */\n public initSelection(): void {\n this.events.onClick((e) => {\n if (e !== undefined && e.button === 'left') {\n if (e.target !== null) {\n const multiSelectionKey = navigator.platform === 'MacIntel' ? 'cmd' : 'ctrl';\n if (this.keyboard.isKeyPressed(multiSelectionKey)) {\n if (e.target.isNode && this.getSelectedEdges().size > 0) {\n this.getSelectedEdges().setSelected(false);\n }\n if (!e.target.isNode && this.getSelectedNodes().size > 0) {\n this.getSelectedNodes().setSelected(false);\n }\n if (e.target.isSelected()) {\n e.target.setSelected(false);\n } else {\n e.target.setSelected(true);\n }\n } else {\n this.getSelectedNodes().setSelected(false);\n this.getSelectedEdges().setSelected(false);\n e.target.setSelected(true);\n }\n } else {\n this.getSelectedNodes().setSelected(false);\n this.getSelectedEdges().setSelected(false);\n }\n }\n });\n }\n\n private setStyles(configuration: IOgmaConfig): void {\n this.LKStyles = new StylesViz(this, {\n node: configuration?.options?.styles?.node || {},\n edge: configuration?.options?.styles?.edge || {}\n });\n this.LKStyles.setNodesDefaultStyles();\n this.LKStyles.setEdgesDefaultStyles();\n }\n\n private setCaptions(configuration: IOgmaConfig): void {\n const nodeMaxTextLength = configuration?.options?.styles?.node?.text?.maxTextLength;\n const edgeMaxTextLength = configuration?.options?.styles?.edge?.text?.maxTextLength;\n this.LKCaptions = new CaptionsViz(this, nodeMaxTextLength, edgeMaxTextLength);\n }\n\n /**\n * Returns Ogma Layout parameters according to visualization layout settings\n * */\n public getForceLayoutParams(mode: ForceLayoutMode, duration = 0): ForceLayoutOptions {\n let dynamicSteps = 300 - ((300 - 40) / 5000) * this.getNodes().size;\n if (dynamicSteps < 40) {\n dynamicSteps = 40;\n }\n return {\n steps: mode === ForceLayoutMode.FAST ? dynamicSteps : 300,\n alignSiblings: this.getNodes().size > 3,\n duration: duration,\n charge: 20,\n gravity: 0.08,\n theta: this.getNodes().size > 100 ? 0.8 : 0.34\n };\n }\n\n public getRadialLayoutParams(\n rootNode: string,\n duration = 0\n ): RadialLayoutOptions<unknown, unknown> {\n return {\n centralNode: rootNode,\n radiusDelta: 1,\n nodeGap: 10,\n repulsion: this.getNodes().size > 80 ? 1 : 6,\n duration: duration\n };\n }\n\n public getHierarchicalLayoutParams(\n mode: HierarchicalLayoutMode,\n rootNode: string,\n duration = 0\n ): HierarchicalLayoutOptions {\n return {\n direction: mode,\n roots: [rootNode],\n duration: duration\n };\n }\n\n /**\n * Initialize graph.\n * add nodes and edges to the viz and init the selection.\n */\n public async init(visualization: {nodes: Array<VizNode>; edges: Array<VizEdge>}): Promise<void> {\n this.clearGraph();\n let selectedEntityType: EntityType | undefined = undefined;\n let selectedElements: Array<string> = [];\n // need to remove selected in every items before adding them to Ogma\n const fixedNodes = visualization.nodes.map((node) => {\n if (node.attributes.selected) {\n selectedEntityType = EntityType.NODE;\n selectedElements.push(node.id);\n }\n delete node.attributes.selected;\n return node;\n });\n const fixedEdges = visualization.edges.map((edge) => {\n if (edge.attributes !== undefined) {\n if (edge.attributes.selected) {\n if (selectedEntityType === undefined || selectedEntityType === EntityType.NODE) {\n selectedEntityType = EntityType.EDGE;\n selectedElements = [];\n }\n selectedElements.push(edge.id);\n }\n delete edge.attributes.selected;\n }\n return edge;\n });\n await this.addGraphAfterValidation({\n nodes: fixedNodes as Array<RawNode<LkNodeData>>,\n edges: fixedEdges as Array<RawEdge<LkEdgeData>>\n });\n if (selectedEntityType === EntityType.NODE) {\n this.getNodes(selectedElements).setSelected(true);\n } else if (selectedEntityType === EntityType.EDGE) {\n this.getEdges(selectedElements).setSelected(true);\n }\n }\n\n public async initVisualization(visualization: PopulatedVisualization) {\n this.init(visualization);\n const styles = StyleRules.sanitizeStylesIndex(visualization.design.styles);\n this.LKStyles.initNodeColors(styles.node);\n this.LKStyles.initNodesIcons(styles.node);\n this.LKStyles.initNodesSizes(styles.node);\n this.LKStyles.initNodesShapes(styles.node);\n this.LKStyles.initEdgesWidth(styles.edge);\n this.LKStyles.initEdgesShape(styles.edge);\n this.LKStyles.initEdgesColor(styles.edge);\n this.LKCaptions.initVizCaptions({\n node: visualization.nodeFields.captions || {},\n edge: visualization.edgeFields.captions || {}\n });\n this.LKTransformation.groupedEdges = visualization.edgeGrouping;\n this.LKTransformation.initTransformation();\n this.LKTransformation.initEdgeGroupingStyle();\n }\n\n /**\n * Adding nodes then adding edges to the graph\n */\n public async addGraphAfterValidation(\n graph: RawGraph<LkNodeData, LkEdgeData>\n ): Promise<{\n nodes: NodeList<LkNodeData>;\n edges: EdgeList<LkEdgeData>;\n }> {\n const addedNodes = await this.addNodes(graph.nodes);\n const addedEdges = await this.addEdges(graph.edges);\n return {\n nodes: addedNodes,\n edges: addedEdges\n };\n }\n\n /**\n * Adding edges to the graph after filtering disconnected ones\n */\n public async addEdges(\n edges: Array<RawEdge<LkEdgeData>>,\n options?: AddItemOptions\n ): Promise<EdgeList> {\n const filteredEdges = edges.filter((edge) => {\n return this.getNode(edge.source) !== undefined && this.getNode(edge.target) !== undefined;\n });\n return super.addEdges(filteredEdges, options);\n }\n\n /**\n * Return the list of non filtered nodes\n */\n public getNonFilteredNodes(items?: Array<any>): NodeList<LkNodeData, LkEdgeData> {\n return Tools.isDefined(items)\n ? this.getNodes(items).filter((i) => !i.hasClass('filtered'))\n : this.getNodes().filter((i) => !i.hasClass('filtered'));\n }\n\n /**\n * Return the list of filtered nodes\n */\n public getFilteredNodes(items?: Array<any>): NodeList<LkNodeData, LkEdgeData> {\n return Tools.isDefined(items)\n ? this.getNodes(items).filter((i) => i.hasClass('filtered'))\n : this.getNodes().filter((i) => i.hasClass('filtered'));\n }\n\n /**\n * Return the list of non filtered edges\n */\n public getNonFilteredEdges(items?: Array<any>): EdgeList<LkEdgeData, LkNodeData> {\n return Tools.isDefined(items)\n ? this.getEdges(items).filter((i) => !i.hasClass('filtered'))\n : this.getEdges('raw').filter((i) => !i.hasClass('filtered'));\n }\n\n /**\n * Return the list of filtered edges\n */\n public getFilteredEdges(\n items?: Array<any>,\n filter: 'visible' | 'raw' | 'all' = 'raw'\n ): EdgeList<LkEdgeData, LkNodeData> {\n return Tools.isDefined(items)\n ? this.getEdges(items).filter((i) => i.hasClass('filtered'))\n : this.getEdges(filter).filter((i) => i.hasClass('filtered'));\n }\n\n /**\n * Do a full reset on ogma and streams of ogma\n */\n public shutDown(): void {\n this.destroy();\n if (this.store) {\n this.store.clear();\n }\n }\n\n /**\n * Reset the Ogma instance so that it can be used fresh in the next visulization\n */\n public clearOgmaState(): void {\n this.reset();\n if (this.store) {\n this.store.clear();\n }\n this.initOgmaLinkuriousParser();\n }\n\n /**\n * Updates the Ogma config when config changes in LKE. If init, options were already set by the Ogma.reset()\n */\n public setConfigOgma(configuration?: IOgmaConfig, init?: boolean): void {\n if (configuration) {\n // here we make sure that the internal config object is updated and we have the correct one when resetting\n this._configuration = configuration;\n }\n if (!init) {\n this.setOptions({\n ...this._configuration.options,\n renderer: this._configuration.renderer\n });\n }\n this.setStyles(this._configuration);\n this.setCaptions(this._configuration);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ogma/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yDAUiC;AACjC,4DAU0B;AAE1B,0BAA8B;AAC9B,0CAAqC;AAErC,8CAA4C;AAC5C,gEAA8D;AAC9D,kDAAgD;AAChD,kDAA0C;AAG1C,yCAAiD;AAAzC,6GAAA,OAAO,OAAQ;AACV,QAAA,kBAAkB,GAAG,GAAG,CAA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ED;;OAEG;IACI,QAAQ;QACb,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;SACpB;IACH,CAAC;IAED;;OAEG;IACI,cAAc;QACnB,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;SACpB;QACD,IAAI,CAAC,wBAAwB,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACI,aAAa,CAAC,aAA2B,EAAE,IAAc;QAC9D,IAAI,aAAa,EAAE;YACjB,0GAA0G;YAC1G,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;SACrC;QACD,IAAI,CAAC,IAAI,EAAE;YACT,IAAI,CAAC,UAAU,iCACV,IAAI,CAAC,cAAc,CAAC,OAAO,KAC9B,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,QAAQ,IACtC,CAAC;SACJ;QACD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACpC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACxC,CAAC;CACF;AA3TD,wBA2TC","sourcesContent":["import {\n EntityType,\n ForceLayoutMode,\n HierarchicalLayoutMode,\n IOgmaConfig,\n LkEdgeData,\n LkNodeData,\n PopulatedVisualization,\n VizEdge,\n VizNode\n} from '@linkurious/rest-client';\nimport Ogma, {\n EdgeList,\n ForceLayoutOptions,\n HierarchicalLayoutOptions,\n NodeList,\n NonObjectPropertyWatcher,\n RadialLayoutOptions,\n RawEdge,\n RawGraph,\n RawNode\n} from '@linkurious/ogma';\n\nimport {StyleRules} from '..';\nimport {Tools} from '../tools/tools';\n\nimport {StylesViz} from './features/styles';\nimport {TransformationsViz} from './features/transformations';\nimport {CaptionsViz} from './features/captions';\nimport {RxViz} from './features/reactive';\nimport {OgmaStore} from './features/OgmaStore';\n\nexport {default as Ogma} from '@linkurious/ogma';\nexport const ANIMATION_DURATION = 750;\n\ninterface AddItemOptions {\n batchSize?: number;\n virtual?: boolean;\n}\n\nexport class LKOgma extends Ogma<LkNodeData, LkEdgeData> {\n public LKStyles!: StylesViz;\n public LKCaptions!: CaptionsViz;\n public LKTransformation!: TransformationsViz;\n // Trigger an event with node category changes\n public nodeCategoriesWatcher!: NonObjectPropertyWatcher<LkNodeData, LkEdgeData>;\n // Trigger an event with edge type changes\n public edgeTypeWatcher!: NonObjectPropertyWatcher<LkNodeData, LkEdgeData>;\n public store!: OgmaStore;\n private _reactive!: RxViz;\n\n constructor(private _configuration: IOgmaConfig) {\n // set Ogma global configuration\n super(_configuration);\n Object.setPrototypeOf(this, new.target.prototype);\n this.initOgmaLinkuriousParser(true);\n }\n\n private initOgmaLinkuriousParser(init?: boolean): void {\n this.nodeCategoriesWatcher = this.schema.watchNodeNonObjectProperty({\n path: 'categories',\n unwindArrays: true,\n filter: 'all'\n });\n this.edgeTypeWatcher = this.schema.watchEdgeNonObjectProperty({\n path: 'type',\n filter: 'all'\n });\n // set ogma max zoom value and selection with mouse option (false?)\n this.setOptions({\n interactions: {\n zoom: {\n maxValue: (params: any) => {\n return 128 / params.smallestNodeSize;\n }\n },\n selection: {\n enabled: false\n }\n }\n });\n\n // only instantiate the store once when app is starting\n if (this._reactive === undefined) {\n this._reactive = new RxViz(this);\n this.store = this._reactive.store;\n } else {\n // if store already exist, but ogma was reset, create new ogma event listener\n this._reactive.listenToSelectionEvents();\n }\n this.initSelection();\n this.setConfigOgma(this._configuration, init);\n this.LKTransformation = new TransformationsViz(this);\n\n this.LKStyles.setNodesDefaultHalo();\n this.LKStyles.setEdgesDefaultHalo();\n this.LKStyles.setBadgeRule();\n this.LKStyles.setFilterClass();\n }\n\n /**\n * Initialize selection behavior\n */\n public initSelection(): void {\n this.events.onClick((e) => {\n if (e !== undefined && e.button === 'left') {\n if (e.target !== null) {\n const multiSelectionKey = navigator.platform === 'MacIntel' ? 'cmd' : 'ctrl';\n if (this.keyboard.isKeyPressed(multiSelectionKey)) {\n if (e.target.isNode && this.getSelectedEdges().size > 0) {\n this.getSelectedEdges().setSelected(false);\n }\n if (!e.target.isNode && this.getSelectedNodes().size > 0) {\n this.getSelectedNodes().setSelected(false);\n }\n if (e.target.isSelected()) {\n e.target.setSelected(false);\n } else {\n e.target.setSelected(true);\n }\n } else {\n this.getSelectedNodes().setSelected(false);\n this.getSelectedEdges().setSelected(false);\n e.target.setSelected(true);\n }\n } else {\n this.getSelectedNodes().setSelected(false);\n this.getSelectedEdges().setSelected(false);\n }\n }\n });\n }\n\n private setStyles(configuration: IOgmaConfig): void {\n this.LKStyles = new StylesViz(this, {\n node: configuration?.options?.styles?.node || {},\n edge: configuration?.options?.styles?.edge || {}\n });\n this.LKStyles.setNodesDefaultStyles();\n this.LKStyles.setEdgesDefaultStyles();\n }\n\n private setCaptions(configuration: IOgmaConfig): void {\n const nodeMaxTextLength = configuration?.options?.styles?.node?.text?.maxTextLength;\n const edgeMaxTextLength = configuration?.options?.styles?.edge?.text?.maxTextLength;\n this.LKCaptions = new CaptionsViz(this, nodeMaxTextLength, edgeMaxTextLength);\n }\n\n /**\n * Returns Ogma Layout parameters according to visualization layout settings\n * */\n public getForceLayoutParams(mode: ForceLayoutMode, duration = 0): ForceLayoutOptions {\n let dynamicSteps = 300 - ((300 - 40) / 5000) * this.getNodes().size;\n if (dynamicSteps < 40) {\n dynamicSteps = 40;\n }\n return {\n steps: mode === ForceLayoutMode.FAST ? dynamicSteps : 300,\n alignSiblings: this.getNodes().size > 3,\n duration: duration,\n charge: 20,\n gravity: 0.08,\n theta: this.getNodes().size > 100 ? 0.8 : 0.34\n };\n }\n\n public getRadialLayoutParams(\n rootNode: string,\n duration = 0\n ): RadialLayoutOptions<unknown, unknown> {\n return {\n centralNode: rootNode,\n radiusDelta: 1,\n nodeGap: 10,\n repulsion: this.getNodes().size > 80 ? 1 : 6,\n duration: duration\n };\n }\n\n public getHierarchicalLayoutParams(\n mode: HierarchicalLayoutMode,\n rootNode: string,\n duration = 0\n ): HierarchicalLayoutOptions {\n return {\n direction: mode,\n roots: [rootNode],\n duration: duration\n };\n }\n\n /**\n * Initialize graph.\n * add nodes and edges to the viz and init the selection.\n */\n public async init(visualization: {nodes: Array<VizNode>; edges: Array<VizEdge>}): Promise<void> {\n this.clearGraph();\n let selectedEntityType: EntityType | undefined = undefined;\n let selectedElements: Array<string> = [];\n // need to remove selected in every items before adding them to Ogma\n const fixedNodes = visualization.nodes.map((node) => {\n if (node.attributes.selected) {\n selectedEntityType = EntityType.NODE;\n selectedElements.push(node.id);\n }\n delete node.attributes.selected;\n return node;\n });\n const fixedEdges = visualization.edges.map((edge) => {\n if (edge.attributes !== undefined) {\n if (edge.attributes.selected) {\n if (selectedEntityType === undefined || selectedEntityType === EntityType.NODE) {\n selectedEntityType = EntityType.EDGE;\n selectedElements = [];\n }\n selectedElements.push(edge.id);\n }\n delete edge.attributes.selected;\n }\n return edge;\n });\n await this.addGraphAfterValidation({\n nodes: fixedNodes as Array<RawNode<LkNodeData>>,\n edges: fixedEdges as Array<RawEdge<LkEdgeData>>\n });\n if (selectedEntityType === EntityType.NODE) {\n this.getNodes(selectedElements).setSelected(true);\n } else if (selectedEntityType === EntityType.EDGE) {\n this.getEdges(selectedElements).setSelected(true);\n }\n }\n\n public async initVisualization(visualization: PopulatedVisualization): Promise<void> {\n await this.init(visualization);\n const styles = StyleRules.sanitizeStylesIndex(visualization.design.styles);\n this.LKStyles.initNodeColors(styles.node);\n this.LKStyles.initNodesIcons(styles.node);\n this.LKStyles.initNodesSizes(styles.node);\n this.LKStyles.initNodesShapes(styles.node);\n this.LKStyles.initEdgesWidth(styles.edge);\n this.LKStyles.initEdgesShape(styles.edge);\n this.LKStyles.initEdgesColor(styles.edge);\n await this.LKCaptions.initVizCaptions({\n node: visualization.nodeFields.captions || {},\n edge: visualization.edgeFields.captions || {}\n });\n this.LKTransformation.groupedEdges = visualization.edgeGrouping;\n await this.LKTransformation.initTransformation();\n this.LKTransformation.initEdgeGroupingStyle();\n }\n\n /**\n * Adding nodes then adding edges to the graph\n */\n public async addGraphAfterValidation(\n graph: RawGraph<LkNodeData, LkEdgeData>\n ): Promise<{\n nodes: NodeList<LkNodeData>;\n edges: EdgeList<LkEdgeData>;\n }> {\n const addedNodes = await this.addNodes(graph.nodes);\n const addedEdges = await this.addEdges(graph.edges);\n return {\n nodes: addedNodes,\n edges: addedEdges\n };\n }\n\n /**\n * Adding edges to the graph after filtering disconnected ones\n */\n public addEdges(edges: Array<RawEdge<LkEdgeData>>, options?: AddItemOptions): Promise<EdgeList> {\n const filteredEdges = edges.filter((edge) => {\n return this.getNode(edge.source) !== undefined && this.getNode(edge.target) !== undefined;\n });\n return super.addEdges(filteredEdges, options);\n }\n\n /**\n * Return the list of non filtered nodes\n */\n public getNonFilteredNodes(items?: Array<any>): NodeList<LkNodeData, LkEdgeData> {\n return Tools.isDefined(items)\n ? this.getNodes(items).filter((i) => !i.hasClass('filtered'))\n : this.getNodes().filter((i) => !i.hasClass('filtered'));\n }\n\n /**\n * Return the list of filtered nodes\n */\n public getFilteredNodes(items?: Array<any>): NodeList<LkNodeData, LkEdgeData> {\n return Tools.isDefined(items)\n ? this.getNodes(items).filter((i) => i.hasClass('filtered'))\n : this.getNodes().filter((i) => i.hasClass('filtered'));\n }\n\n /**\n * Return the list of non filtered edges\n */\n public getNonFilteredEdges(items?: Array<any>): EdgeList<LkEdgeData, LkNodeData> {\n return Tools.isDefined(items)\n ? this.getEdges(items).filter((i) => !i.hasClass('filtered'))\n : this.getEdges('raw').filter((i) => !i.hasClass('filtered'));\n }\n\n /**\n * Return the list of filtered edges\n */\n public getFilteredEdges(\n items?: Array<any>,\n filter: 'visible' | 'raw' | 'all' = 'raw'\n ): EdgeList<LkEdgeData, LkNodeData> {\n return Tools.isDefined(items)\n ? this.getEdges(items).filter((i) => i.hasClass('filtered'))\n : this.getEdges(filter).filter((i) => i.hasClass('filtered'));\n }\n\n /**\n * Do a full reset on ogma and streams of ogma\n */\n public shutDown(): void {\n this.destroy();\n if (this.store) {\n this.store.clear();\n }\n }\n\n /**\n * Reset the Ogma instance so that it can be used fresh in the next visulization\n */\n public clearOgmaState(): void {\n this.reset();\n if (this.store) {\n this.store.clear();\n }\n this.initOgmaLinkuriousParser();\n }\n\n /**\n * Updates the Ogma config when config changes in LKE. If init, options were already set by the Ogma.reset()\n */\n public setConfigOgma(configuration?: IOgmaConfig, init?: boolean): void {\n if (configuration) {\n // here we make sure that the internal config object is updated and we have the correct one when resetting\n this._configuration = configuration;\n }\n if (!init) {\n this.setOptions({\n ...this._configuration.options,\n renderer: this._configuration.renderer\n });\n }\n this.setStyles(this._configuration);\n this.setCaptions(this._configuration);\n }\n}\n"]}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Color } from '@linkurious/ogma';
|
|
2
|
-
import { LkEdgeData, OgmaEdgeShape } from '@linkurious/rest-client';
|
|
2
|
+
import { IEdgeStyle, LkEdgeData, OgmaEdgeShape } from '@linkurious/rest-client';
|
|
3
3
|
import { StyleRule } from './styleRule';
|
|
4
4
|
import { ItemAttributes } from './itemAttributes';
|
|
5
5
|
export declare enum EdgeWidthExtrema {
|
|
6
6
|
MIN = 50,
|
|
7
7
|
MAX = 200
|
|
8
8
|
}
|
|
9
|
-
export declare class EdgeAttributes extends ItemAttributes {
|
|
9
|
+
export declare class EdgeAttributes extends ItemAttributes<IEdgeStyle> {
|
|
10
10
|
constructor(rulesMap: {
|
|
11
|
-
color?: Array<StyleRule
|
|
12
|
-
shape?: Array<StyleRule
|
|
13
|
-
width?: Array<StyleRule
|
|
11
|
+
color?: Array<StyleRule<IEdgeStyle>>;
|
|
12
|
+
shape?: Array<StyleRule<IEdgeStyle>>;
|
|
13
|
+
width?: Array<StyleRule<IEdgeStyle>>;
|
|
14
14
|
});
|
|
15
15
|
/**
|
|
16
16
|
* Return rule that can be applied to the data
|
|
@@ -27,20 +27,20 @@ export declare class EdgeAttributes extends ItemAttributes {
|
|
|
27
27
|
/**
|
|
28
28
|
* Generate size for a given node
|
|
29
29
|
*/
|
|
30
|
-
width(data: LkEdgeData): string | undefined;
|
|
30
|
+
width(data: LkEdgeData): string | number | undefined;
|
|
31
31
|
/**
|
|
32
32
|
* return the corresponding width to the value
|
|
33
33
|
* @param value
|
|
34
34
|
* @param rule
|
|
35
35
|
* @param isLog
|
|
36
36
|
*/
|
|
37
|
-
static getAutomaticRangeWidth(value: number, rule: StyleRule
|
|
37
|
+
static getAutomaticRangeWidth(value: number, rule: StyleRule<IEdgeStyle>, isLog?: boolean): string | undefined;
|
|
38
38
|
/**
|
|
39
39
|
* Return an object containing all node attributes needed by Ogma to style a node
|
|
40
40
|
*/
|
|
41
41
|
all(data: LkEdgeData): {
|
|
42
42
|
color: Color;
|
|
43
43
|
shape: OgmaEdgeShape | undefined;
|
|
44
|
-
width: string | undefined;
|
|
44
|
+
width: string | undefined | number;
|
|
45
45
|
};
|
|
46
46
|
}
|