@krainovsd/graph 0.12.0-beta.5 → 0.12.0-beta.6

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/lib/cjs/index.cjs CHANGED
@@ -2567,7 +2567,38 @@ class GraphCanvas {
2567
2567
  this.area.width = this.dpi * this.width;
2568
2568
  this.area.height = this.dpi * this.height;
2569
2569
  this.areaRect = this.area.getBoundingClientRect();
2570
+ this.context = this.area.getContext("2d");
2571
+ if (!this.context)
2572
+ throw new Error("couldn't create canvas context");
2573
+ this.context.scale(this.dpi, this.dpi);
2570
2574
  this.draw();
2575
+ // this.clearHTMLElements();
2576
+ // initArea.call<
2577
+ // GraphCanvas<NodeData, LinkData>,
2578
+ // Parameters<typeof initArea>,
2579
+ // ReturnType<typeof initArea>
2580
+ // >(this);
2581
+ // initDnd.call<
2582
+ // GraphCanvas<NodeData, LinkData>,
2583
+ // Parameters<typeof initDnd>,
2584
+ // ReturnType<typeof initDnd>
2585
+ // >(this);
2586
+ // initZoom.call<
2587
+ // GraphCanvas<NodeData, LinkData>,
2588
+ // Parameters<typeof initZoom>,
2589
+ // ReturnType<typeof initZoom>
2590
+ // >(this);
2591
+ // initResize.call<
2592
+ // GraphCanvas<NodeData, LinkData>,
2593
+ // Parameters<typeof initResize>,
2594
+ // ReturnType<typeof initResize>
2595
+ // >(this);
2596
+ // initPointer.call<
2597
+ // GraphCanvas<NodeData, LinkData>,
2598
+ // Parameters<typeof initPointer>,
2599
+ // ReturnType<typeof initPointer>
2600
+ // >(this);
2601
+ // this.draw();
2571
2602
  }
2572
2603
  clearCache(keys) {
2573
2604
  if (!keys) {