@linkurious/ogma-linkurious-parser 3.1.13 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/captions/captions.js +42 -54
  2. package/dist/captions/captions.js.map +1 -1
  3. package/dist/filters/filters.d.ts +1 -1
  4. package/dist/filters/filters.js +55 -76
  5. package/dist/filters/filters.js.map +1 -1
  6. package/dist/index.js +34 -33
  7. package/dist/index.js.map +1 -1
  8. package/dist/ogma/features/OgmaStore.js +16 -30
  9. package/dist/ogma/features/OgmaStore.js.map +1 -1
  10. package/dist/ogma/features/captions.js +43 -87
  11. package/dist/ogma/features/captions.js.map +1 -1
  12. package/dist/ogma/features/reactive.js +58 -75
  13. package/dist/ogma/features/reactive.js.map +1 -1
  14. package/dist/ogma/features/selectors.d.ts +5 -5
  15. package/dist/ogma/features/selectors.js +25 -16
  16. package/dist/ogma/features/selectors.js.map +1 -1
  17. package/dist/ogma/features/styles.js +115 -137
  18. package/dist/ogma/features/styles.js.map +1 -1
  19. package/dist/ogma/features/transformations.js +39 -87
  20. package/dist/ogma/features/transformations.js.map +1 -1
  21. package/dist/ogma/index.js +140 -230
  22. package/dist/ogma/index.js.map +1 -1
  23. package/dist/styles/edgeAttributes.js +31 -47
  24. package/dist/styles/edgeAttributes.js.map +1 -1
  25. package/dist/styles/itemAttributes.js +33 -42
  26. package/dist/styles/itemAttributes.js.map +1 -1
  27. package/dist/styles/nodeAttributes.js +49 -71
  28. package/dist/styles/nodeAttributes.js.map +1 -1
  29. package/dist/styles/styleRule.js +57 -68
  30. package/dist/styles/styleRule.js.map +1 -1
  31. package/dist/styles/styleRules.js +150 -192
  32. package/dist/styles/styleRules.js.map +1 -1
  33. package/dist/tools/colorPalette.js +1 -0
  34. package/dist/tools/colorPalette.js.map +1 -1
  35. package/dist/tools/ogmaTool.js +28 -30
  36. package/dist/tools/ogmaTool.js.map +1 -1
  37. package/dist/tools/tools.js +88 -91
  38. package/dist/tools/tools.js.map +1 -1
  39. package/package.json +7 -7
@@ -1,19 +1,9 @@
1
1
  'use strict';
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
- var __1 = require("../..");
15
- var tools_1 = require("../../tools/tools");
16
- var HOVERED_SELECTED_NODE_STYLE = {
3
+ exports.StylesViz = exports.FILTER_OPACITY = void 0;
4
+ const __1 = require("../..");
5
+ const tools_1 = require("../../tools/tools");
6
+ const HOVERED_SELECTED_NODE_STYLE = {
17
7
  text: {
18
8
  style: 'bold',
19
9
  backgroundColor: '#fff',
@@ -22,7 +12,7 @@ var HOVERED_SELECTED_NODE_STYLE = {
22
12
  outerStroke: { width: 2 },
23
13
  outline: false
24
14
  };
25
- var HOVERED_SELECTED_EDGE_STYLE = {
15
+ const HOVERED_SELECTED_EDGE_STYLE = {
26
16
  text: {
27
17
  style: 'bold',
28
18
  backgroundColor: '#fff',
@@ -30,25 +20,25 @@ var HOVERED_SELECTED_EDGE_STYLE = {
30
20
  },
31
21
  outline: false
32
22
  };
33
- var NODE_HALO_CONFIGURATION = {
23
+ const NODE_HALO_CONFIGURATION = {
34
24
  color: '#FFF',
35
25
  width: 7,
36
26
  scalingMethod: 'scaled',
37
27
  strokeWidth: 0,
38
28
  hideNonAdjacentEdges: false
39
29
  };
40
- var EDGE_HALO_CONFIGURATION = {
30
+ const EDGE_HALO_CONFIGURATION = {
41
31
  color: '#FFF',
42
32
  scalingMethod: 'scaled',
43
33
  width: 4
44
34
  };
45
- var DEFAULT_OGMA_FONT = "'roboto', sans-serif";
46
- var DARK_FONT_COLOR = '#000';
47
- var CLEAR_FONT_COLOR = '#FFF';
48
- var ITEM_DEFAULT_COLOR = '#7f7f7f';
35
+ const DEFAULT_OGMA_FONT = "'roboto', sans-serif";
36
+ const DARK_FONT_COLOR = '#000';
37
+ const CLEAR_FONT_COLOR = '#FFF';
38
+ const ITEM_DEFAULT_COLOR = '#7f7f7f';
49
39
  exports.FILTER_OPACITY = 0.2;
50
- var StylesViz = /** @class */ (function () {
51
- function StylesViz(ogma, configuration) {
40
+ class StylesViz {
41
+ constructor(ogma, configuration) {
52
42
  this._nodeAttributes = new __1.NodeAttributes({});
53
43
  this._edgeAttributes = new __1.EdgeAttributes({});
54
44
  this._ogma = ogma;
@@ -57,7 +47,7 @@ var StylesViz = /** @class */ (function () {
57
47
  /**
58
48
  * Set nodes default styles based on the configuration
59
49
  */
60
- StylesViz.prototype.setNodesDefaultStyles = function () {
50
+ setNodesDefaultStyles() {
61
51
  // setting selection and hover attributes
62
52
  this._ogma.styles.setHoveredNodeAttributes(HOVERED_SELECTED_NODE_STYLE);
63
53
  this._ogma.styles.setSelectedNodeAttributes(HOVERED_SELECTED_NODE_STYLE);
@@ -65,6 +55,7 @@ var StylesViz = /** @class */ (function () {
65
55
  this._nodeDefaultStylesRules = this._ogma.styles.addRule({
66
56
  nodeAttributes: {
67
57
  text: {
58
+ padding: 5,
68
59
  minVisibleSize: this._defaultConfiguration.node.text !== undefined &&
69
60
  this._defaultConfiguration.node.text.minVisibleSize
70
61
  ? this._defaultConfiguration.node.text.minVisibleSize
@@ -109,11 +100,11 @@ var StylesViz = /** @class */ (function () {
109
100
  outline: false
110
101
  }
111
102
  });
112
- };
103
+ }
113
104
  /**
114
105
  * Set edges default styles based on the configuration
115
106
  */
116
- StylesViz.prototype.setEdgesDefaultStyles = function () {
107
+ setEdgesDefaultStyles() {
117
108
  // setting selection and hover attributes
118
109
  this._ogma.styles.setHoveredEdgeAttributes(HOVERED_SELECTED_EDGE_STYLE);
119
110
  this._ogma.styles.setSelectedEdgeAttributes(HOVERED_SELECTED_EDGE_STYLE);
@@ -154,23 +145,22 @@ var StylesViz = /** @class */ (function () {
154
145
  color: ITEM_DEFAULT_COLOR
155
146
  }
156
147
  });
157
- };
148
+ }
158
149
  /**
159
150
  * Set nodes default styles based on the configuration
160
151
  */
161
- StylesViz.prototype.setNodesDefaultHalo = function () {
162
- var _this = this;
152
+ setNodesDefaultHalo() {
163
153
  // setting default halo style
164
154
  this._nodeDefaultHaloRules = this._ogma.styles.addRule({
165
- nodeSelector: function (node) { return node && !node.hasClass('filtered'); },
155
+ nodeSelector: (node) => node && !node.hasClass('filtered'),
166
156
  nodeAttributes: {
167
- halo: function (node) {
157
+ halo: (node) => {
168
158
  if (node !== undefined &&
169
159
  !node.hasClass('filtered') &&
170
160
  (node.isSelected() ||
171
161
  node.getAdjacentNodes({}).isSelected().includes(true) ||
172
162
  node.getAdjacentEdges().isSelected().includes(true))) {
173
- return __assign(__assign({}, NODE_HALO_CONFIGURATION), { scalingMethod: _this._ogma.geo.enabled() ? 'fixed' : 'scaled' });
163
+ return Object.assign(Object.assign({}, NODE_HALO_CONFIGURATION), { scalingMethod: this._ogma.geo.enabled() ? 'fixed' : 'scaled' });
174
164
  }
175
165
  return null;
176
166
  }
@@ -189,23 +179,20 @@ var StylesViz = /** @class */ (function () {
189
179
  }
190
180
  }
191
181
  });
192
- };
182
+ }
193
183
  /**
194
184
  * Set edges default styles based on the configuration
195
185
  */
196
- StylesViz.prototype.setEdgesDefaultHalo = function () {
197
- var _this = this;
186
+ setEdgesDefaultHalo() {
198
187
  // setting default halo styles
199
188
  this._edgeDefaultHaloRules = this._ogma.styles.addRule({
200
- edgeSelector: function (edge) {
201
- return edge && edge.getSource() && edge.getTarget() && !edge.hasClass('filtered');
202
- },
189
+ edgeSelector: (edge) => edge && edge.getSource() && edge.getTarget() && !edge.hasClass('filtered'),
203
190
  edgeAttributes: {
204
- halo: function (edge) {
191
+ halo: (edge) => {
205
192
  if (edge &&
206
193
  !edge.hasClass('filtered') &&
207
194
  (edge.isSelected() || edge.getSource().isSelected() || edge.getTarget().isSelected())) {
208
- return __assign(__assign({}, EDGE_HALO_CONFIGURATION), { scalingMethod: _this._ogma.geo.enabled() ? 'fixed' : 'scaled' });
195
+ return Object.assign(Object.assign({}, EDGE_HALO_CONFIGURATION), { scalingMethod: this._ogma.geo.enabled() ? 'fixed' : 'scaled' });
209
196
  }
210
197
  return null;
211
198
  }
@@ -221,36 +208,36 @@ var StylesViz = /** @class */ (function () {
221
208
  }
222
209
  }
223
210
  });
224
- };
211
+ }
225
212
  /**
226
213
  * Return the default node radius set in configuration or 5
227
214
  *
228
215
  * @returns {number}
229
216
  */
230
- StylesViz.prototype.defaultNodeRadius = function (styles) {
217
+ defaultNodeRadius(styles) {
231
218
  return this.defaultStylesHas(styles, ['nodeRadius']) ? styles.nodeRadius : 5;
232
- };
219
+ }
233
220
  /**
234
221
  * Return the default edge width set in configuration or 1
235
222
  *
236
223
  * @returns {number}
237
224
  */
238
- StylesViz.prototype.defaultEdgeWidth = function (styles) {
225
+ defaultEdgeWidth(styles) {
239
226
  return this.defaultStylesHas(styles, ['edgeWidth']) ? styles.edgeWidth : 1;
240
- };
227
+ }
241
228
  /**
242
229
  * Check if a style property exists in the default styles object
243
230
  */
244
- StylesViz.prototype.defaultStylesHas = function (styles, propertyPath) {
231
+ defaultStylesHas(styles, propertyPath) {
245
232
  if (!tools_1.Tools.isDefined(styles)) {
246
233
  return false;
247
234
  }
248
235
  return tools_1.Tools.getIn(styles, propertyPath) !== undefined;
249
- };
236
+ }
250
237
  /**
251
238
  * Set styles for the class "filtered"
252
239
  */
253
- StylesViz.prototype.setFilterClass = function () {
240
+ setFilterClass() {
254
241
  this._ogma.styles.createClass({
255
242
  name: 'filtered',
256
243
  nodeAttributes: {
@@ -287,11 +274,11 @@ var StylesViz = /** @class */ (function () {
287
274
  width: 0.2
288
275
  }
289
276
  });
290
- };
277
+ }
291
278
  /**
292
279
  * Set the class for exported nodes and edges
293
280
  */
294
- StylesViz.prototype.setExportClass = function (textWrappingLength) {
281
+ setExportClass(textWrappingLength) {
295
282
  if (!this._exportClass) {
296
283
  this._exportClass = this._ogma.styles.createClass({
297
284
  name: 'exported',
@@ -322,29 +309,28 @@ var StylesViz = /** @class */ (function () {
322
309
  }
323
310
  });
324
311
  }
325
- };
312
+ }
326
313
  /**
327
314
  * Set the rule to display badges
328
315
  */
329
- StylesViz.prototype.setBadgeRule = function () {
330
- var _this = this;
316
+ setBadgeRule() {
331
317
  this._ogma.styles.createClass({
332
318
  name: 'degreeIndicator',
333
319
  nodeAttributes: {
334
320
  badges: {
335
- topRight: function (node) {
321
+ topRight: (node) => {
336
322
  if (node !== undefined) {
337
- var degree = tools_1.Tools.getHiddenNeighbors(node.toList());
338
- var badgeContent = tools_1.Tools.formatNumber(degree);
323
+ const degree = tools_1.Tools.getHiddenNeighbors(node.toList());
324
+ const badgeContent = tools_1.Tools.formatNumber(degree);
339
325
  if (degree > 0) {
340
- var nodeColor = Array.isArray(node.getAttribute('color'))
326
+ const nodeColor = Array.isArray(node.getAttribute('color'))
341
327
  ? node.getAttribute('color')[0]
342
328
  : node.getAttribute('color');
343
- var textColor = __1.OgmaTools.isBright(nodeColor)
329
+ const textColor = __1.OgmaTools.isBright(nodeColor)
344
330
  ? DARK_FONT_COLOR
345
331
  : CLEAR_FONT_COLOR;
346
- var isSupernode = node.getData(['statistics', 'supernode']);
347
- var content = null;
332
+ const isSupernode = node.getData(['statistics', 'supernode']);
333
+ let content = null;
348
334
  if (+badgeContent !== 0) {
349
335
  content = isSupernode ? badgeContent + '+' : badgeContent;
350
336
  }
@@ -356,9 +342,9 @@ var StylesViz = /** @class */ (function () {
356
342
  color: null
357
343
  },
358
344
  text: {
359
- font: _this._defaultConfiguration.node.text !== undefined &&
360
- _this._defaultConfiguration.node.text.font !== undefined
361
- ? _this._defaultConfiguration.node.text.font
345
+ font: this._defaultConfiguration.node.text !== undefined &&
346
+ this._defaultConfiguration.node.text.font !== undefined
347
+ ? this._defaultConfiguration.node.text.font
362
348
  : DEFAULT_OGMA_FONT,
363
349
  scale: 0.4,
364
350
  color: textColor,
@@ -375,12 +361,12 @@ var StylesViz = /** @class */ (function () {
375
361
  name: 'pinnedIndicator',
376
362
  nodeAttributes: {
377
363
  badges: {
378
- bottomRight: function (node) {
364
+ bottomRight: (node) => {
379
365
  if (node !== undefined && !node.getAttribute('layoutable')) {
380
- var nodeColor = Array.isArray(node.getAttribute('color'))
366
+ const nodeColor = Array.isArray(node.getAttribute('color'))
381
367
  ? node.getAttribute('color')[0]
382
368
  : node.getAttribute('color');
383
- var textColor = __1.OgmaTools.isBright(nodeColor)
369
+ const textColor = __1.OgmaTools.isBright(nodeColor)
384
370
  ? DARK_FONT_COLOR
385
371
  : CLEAR_FONT_COLOR;
386
372
  return {
@@ -405,43 +391,42 @@ var StylesViz = /** @class */ (function () {
405
391
  self: { attributes: ['layoutable'] }
406
392
  }
407
393
  });
408
- this._ogma.events.on('addNodes', function (nodesEvent) { return nodesEvent.nodes.addClass('degreeIndicator'); });
409
- this._ogma.events.on('addNodes', function (nodesEvent) { return nodesEvent.nodes.addClass('pinnedIndicator'); });
410
- };
394
+ this._ogma.events.on('addNodes', (nodesEvent) => nodesEvent.nodes.addClass('degreeIndicator'));
395
+ this._ogma.events.on('addNodes', (nodesEvent) => nodesEvent.nodes.addClass('pinnedIndicator'));
396
+ }
411
397
  /**
412
398
  * Delete the rule to display badges
413
399
  */
414
- StylesViz.prototype.deleteBadgeRule = function () {
400
+ deleteBadgeRule() {
415
401
  this._ogma.getNodes().removeClasses(['degreeIndicator', 'pinnedIndicator'], 0);
416
- };
402
+ }
417
403
  /**
418
404
  * set text overlap to true or false
419
405
  *
420
406
  * @param {boolean} overlap
421
407
  */
422
- StylesViz.prototype.toggleTextOverlap = function (overlap) {
408
+ toggleTextOverlap(overlap) {
423
409
  this._ogma.setOptions({ texts: { preventOverlap: overlap } });
424
- };
410
+ }
425
411
  /**
426
412
  * refresh nodes and edge rules
427
413
  *
428
414
  */
429
- StylesViz.prototype.refreshRules = function () {
415
+ refreshRules() {
430
416
  this._nodeDefaultStylesRules.refresh();
431
417
  this._edgeDefaultStylesRules.refresh();
432
- };
418
+ }
433
419
  /**
434
420
  * Create / refresh an ogma rule for node colors
435
421
  */
436
- StylesViz.prototype.refreshNodeColors = function (colorStyleRules) {
437
- var _this = this;
422
+ refreshNodeColors(colorStyleRules) {
438
423
  if (!tools_1.Tools.isDefined(this._ogmaNodeColor)) {
439
424
  this._nodeAttributes.refresh({ color: colorStyleRules });
440
425
  this._ogmaNodeColor = this._ogma.styles.addRule({
441
426
  nodeAttributes: {
442
- color: function (node) {
427
+ color: (node) => {
443
428
  if (node !== undefined) {
444
- return _this._nodeAttributes.color(node.getData());
429
+ return this._nodeAttributes.color(node.getData());
445
430
  }
446
431
  }
447
432
  },
@@ -454,60 +439,59 @@ var StylesViz = /** @class */ (function () {
454
439
  // TODO refresh node icons when moving the code from LKE
455
440
  // this.refreshIconsColor();
456
441
  }
457
- };
442
+ }
458
443
  /**
459
444
  * Return an array of StyleRules with only the style that need to be applied
460
445
  */
461
- StylesViz.prototype.getStyleRule = function (state, styleType) {
446
+ getStyleRule(state, styleType) {
462
447
  return new __1.StyleRules(state)[styleType];
463
- };
464
- StylesViz.prototype.initNodeColors = function (nodeRules) {
465
- var nodeColorRules = this.getStyleRule(nodeRules, __1.StyleType.COLOR);
448
+ }
449
+ initNodeColors(nodeRules) {
450
+ const nodeColorRules = this.getStyleRule(nodeRules, __1.StyleType.COLOR);
466
451
  this.refreshNodeColors(nodeColorRules);
467
- };
468
- StylesViz.prototype.initNodesIcons = function (nodeRules) {
469
- var nodeIconsRules = this.getStyleRule(nodeRules, __1.StyleType.ICON);
452
+ }
453
+ initNodesIcons(nodeRules) {
454
+ const nodeIconsRules = this.getStyleRule(nodeRules, __1.StyleType.ICON);
470
455
  this.refreshNodeIcons(nodeIconsRules);
471
- };
472
- StylesViz.prototype.initNodesSizes = function (nodeRules) {
473
- var nodeSizeRules = this.getStyleRule(nodeRules, __1.StyleType.SIZE);
456
+ }
457
+ initNodesSizes(nodeRules) {
458
+ const nodeSizeRules = this.getStyleRule(nodeRules, __1.StyleType.SIZE);
474
459
  this.refreshNodeSize(nodeSizeRules);
475
- };
476
- StylesViz.prototype.initNodesShapes = function (nodeRules) {
477
- var nodeShapesRules = this.getStyleRule(nodeRules, __1.StyleType.SHAPE);
460
+ }
461
+ initNodesShapes(nodeRules) {
462
+ const nodeShapesRules = this.getStyleRule(nodeRules, __1.StyleType.SHAPE);
478
463
  this.refreshNodeShape(nodeShapesRules);
479
- };
480
- StylesViz.prototype.initEdgesWidth = function (edgeRules) {
481
- var edgesWidthRules = this.getStyleRule(edgeRules, __1.StyleType.WIDTH);
464
+ }
465
+ initEdgesWidth(edgeRules) {
466
+ const edgesWidthRules = this.getStyleRule(edgeRules, __1.StyleType.WIDTH);
482
467
  this.refreshEdgeWidth(edgesWidthRules);
483
- };
484
- StylesViz.prototype.initEdgesShape = function (edgeRules) {
485
- var edgesShapeRules = this.getStyleRule(edgeRules, __1.StyleType.SHAPE);
468
+ }
469
+ initEdgesShape(edgeRules) {
470
+ const edgesShapeRules = this.getStyleRule(edgeRules, __1.StyleType.SHAPE);
486
471
  this.refreshEdgeShape(edgesShapeRules);
487
- };
488
- StylesViz.prototype.initEdgesColor = function (edgeRules) {
489
- var edgesColorRules = this.getStyleRule(edgeRules, __1.StyleType.COLOR);
472
+ }
473
+ initEdgesColor(edgeRules) {
474
+ const edgesColorRules = this.getStyleRule(edgeRules, __1.StyleType.COLOR);
490
475
  this.refreshEdgeColors(edgesColorRules);
491
- };
476
+ }
492
477
  /**
493
478
  * Create / refresh an ogma rule for node icons
494
479
  *
495
480
  * @param {Array<any>} iconStyleRules
496
481
  */
497
- StylesViz.prototype.refreshNodeIcons = function (iconStyleRules) {
498
- var _this = this;
482
+ refreshNodeIcons(iconStyleRules) {
499
483
  if (!tools_1.Tools.isDefined(this._ogmaNodeIcon)) {
500
484
  this._nodeAttributes.refresh({ icon: iconStyleRules });
501
485
  this._ogmaNodeIcon = this._ogma.styles.addRule({
502
486
  nodeAttributes: {
503
- icon: function (node) {
487
+ icon: (node) => {
504
488
  if (node !== undefined) {
505
- return _this._nodeAttributes.icon(node.getData()).icon;
489
+ return this._nodeAttributes.icon(node.getData()).icon;
506
490
  }
507
491
  },
508
- image: function (node) {
492
+ image: (node) => {
509
493
  if (node !== undefined) {
510
- return _this._nodeAttributes.icon(node.getData()).image;
494
+ return this._nodeAttributes.icon(node.getData()).image;
511
495
  }
512
496
  }
513
497
  },
@@ -518,21 +502,20 @@ var StylesViz = /** @class */ (function () {
518
502
  this._nodeAttributes.refresh({ icon: iconStyleRules });
519
503
  this._ogmaNodeIcon.refresh();
520
504
  }
521
- };
505
+ }
522
506
  /**
523
507
  * Create / refresh an ogma rule for node sizes
524
508
  *
525
509
  * @param {Array<any>} sizeStyleRules
526
510
  */
527
- StylesViz.prototype.refreshNodeSize = function (sizeStyleRules) {
528
- var _this = this;
511
+ refreshNodeSize(sizeStyleRules) {
529
512
  if (!tools_1.Tools.isDefined(this._ogmaNodeSize)) {
530
513
  this._nodeAttributes.refresh({ size: sizeStyleRules });
531
514
  this._ogmaNodeSize = this._ogma.styles.addRule({
532
515
  nodeAttributes: {
533
- radius: function (node) {
516
+ radius: (node) => {
534
517
  if (node !== undefined) {
535
- return _this._nodeAttributes.size(node.getData());
518
+ return this._nodeAttributes.size(node.getData());
536
519
  }
537
520
  }
538
521
  },
@@ -543,21 +526,20 @@ var StylesViz = /** @class */ (function () {
543
526
  this._nodeAttributes.refresh({ size: sizeStyleRules });
544
527
  this._ogmaNodeSize.refresh();
545
528
  }
546
- };
529
+ }
547
530
  /**
548
531
  * Create / refresh an ogma rule for node images
549
532
  *
550
533
  * @param {Array<any>} shapeStyleRules
551
534
  */
552
- StylesViz.prototype.refreshNodeShape = function (shapeStyleRules) {
553
- var _this = this;
535
+ refreshNodeShape(shapeStyleRules) {
554
536
  if (!tools_1.Tools.isDefined(this._ogmaNodeShape)) {
555
537
  this._nodeAttributes.refresh({ shape: shapeStyleRules });
556
538
  this._ogmaNodeShape = this._ogma.styles.addRule({
557
539
  nodeAttributes: {
558
- shape: function (node) {
540
+ shape: (node) => {
559
541
  if (node !== undefined) {
560
- return _this._nodeAttributes.shape(node.getData());
542
+ return this._nodeAttributes.shape(node.getData());
561
543
  }
562
544
  }
563
545
  },
@@ -568,19 +550,18 @@ var StylesViz = /** @class */ (function () {
568
550
  this._nodeAttributes.refresh({ shape: shapeStyleRules });
569
551
  this._ogmaNodeShape.refresh();
570
552
  }
571
- };
553
+ }
572
554
  /**
573
555
  * Create / refresh an ogma rule for edge colors
574
556
  */
575
- StylesViz.prototype.refreshEdgeColors = function (colorStyleRules) {
576
- var _this = this;
557
+ refreshEdgeColors(colorStyleRules) {
577
558
  if (!tools_1.Tools.isDefined(this._ogmaEdgeColor)) {
578
559
  this._edgeAttributes.refresh({ color: colorStyleRules });
579
560
  this._ogmaEdgeColor = this._ogma.styles.addRule({
580
561
  edgeAttributes: {
581
- color: function (edge) {
562
+ color: (edge) => {
582
563
  if (edge !== undefined) {
583
- return _this._edgeAttributes.color(edge.getData());
564
+ return this._edgeAttributes.color(edge.getData());
584
565
  }
585
566
  }
586
567
  },
@@ -591,21 +572,20 @@ var StylesViz = /** @class */ (function () {
591
572
  this._edgeAttributes.refresh({ color: colorStyleRules });
592
573
  this._ogmaEdgeColor.refresh();
593
574
  }
594
- };
575
+ }
595
576
  /**
596
577
  * Create / refresh an ogma rule for edge width
597
578
  *
598
579
  * @param {Array<LKStyleRule>} widthStyleRules
599
580
  */
600
- StylesViz.prototype.refreshEdgeWidth = function (widthStyleRules) {
601
- var _this = this;
581
+ refreshEdgeWidth(widthStyleRules) {
602
582
  if (!tools_1.Tools.isDefined(this._ogmaEdgeWidth)) {
603
583
  this._edgeAttributes.refresh({ width: widthStyleRules });
604
584
  this._ogmaEdgeWidth = this._ogma.styles.addRule({
605
585
  edgeAttributes: {
606
- width: function (edge) {
586
+ width: (edge) => {
607
587
  if (edge !== undefined) {
608
- return _this._edgeAttributes.width(edge.getData());
588
+ return this._edgeAttributes.width(edge.getData());
609
589
  }
610
590
  }
611
591
  },
@@ -618,21 +598,20 @@ var StylesViz = /** @class */ (function () {
618
598
  this._edgeAttributes.refresh({ width: widthStyleRules });
619
599
  this._ogmaEdgeWidth.refresh();
620
600
  }
621
- };
601
+ }
622
602
  /**
623
603
  * Create / refresh an ogma rule for edge width
624
604
  *
625
605
  * @param {Array<LKStyleRule>} shapeStyleRules
626
606
  */
627
- StylesViz.prototype.refreshEdgeShape = function (shapeStyleRules) {
628
- var _this = this;
607
+ refreshEdgeShape(shapeStyleRules) {
629
608
  if (!tools_1.Tools.isDefined(this._ogmaEdgeShape)) {
630
609
  this._edgeAttributes.refresh({ shape: shapeStyleRules });
631
610
  this._ogmaEdgeShape = this._ogma.styles.addRule({
632
611
  edgeAttributes: {
633
- shape: function (edge) {
612
+ shape: (edge) => {
634
613
  if (edge !== undefined) {
635
- return _this._edgeAttributes.shape(edge.getData());
614
+ return this._edgeAttributes.shape(edge.getData());
636
615
  }
637
616
  }
638
617
  },
@@ -643,8 +622,7 @@ var StylesViz = /** @class */ (function () {
643
622
  this._edgeAttributes.refresh({ shape: shapeStyleRules });
644
623
  this._ogmaEdgeShape.refresh();
645
624
  }
646
- };
647
- return StylesViz;
648
- }());
625
+ }
626
+ }
649
627
  exports.StylesViz = StylesViz;
650
628
  //# sourceMappingURL=styles.js.map