@data-navigator/inspector 1.1.1 → 1.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-navigator/inspector",
3
- "version": "1.1.1",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "author": "Frank Elavsky",
6
6
  "license": "MIT",
package/src/inspector.js CHANGED
@@ -153,8 +153,9 @@ export function Inspector({
153
153
  if (!rootEl.id) rootEl.id = rootId;
154
154
 
155
155
  // Build the graph SVG
156
- const graphWidth = mode === 'tree' ? size * 2 : size;
157
- const graphHeight = mode === 'tree' ? Math.round(size * 1.5) : size;
156
+ const sizeIsObject = size !== null && typeof size === 'object';
157
+ const graphWidth = sizeIsObject ? size.width : mode === 'tree' ? size * 2 : size;
158
+ const graphHeight = sizeIsObject ? size.height : mode === 'tree' ? Math.round(size * 1.5) : size;
158
159
  const nodeArray = convertToArray(structure.nodes, nodeInclusions);
159
160
  const linkArray = convertToArray(structure.edges, [], edgeExclusions);
160
161
  const idPrefix = rootId + '-';
@@ -173,6 +174,12 @@ export function Inspector({
173
174
  ? TreeGraph({ nodes: nodeArray, links: linkArray }, { ...graphOptions, dimensions: structure.dimensions })
174
175
  : ForceGraph({ nodes: nodeArray, links: linkArray }, graphOptions);
175
176
 
177
+ // When explicit pixel dimensions are given, remove the auto-scaling inline style so the
178
+ // SVG renders at exactly the specified size rather than scaling to container width.
179
+ if (sizeIsObject) {
180
+ graph.style.cssText = 'display: block;';
181
+ }
182
+
176
183
  // Create wrapper structure
177
184
  const wrapperEl = document.createElement('div');
178
185
  wrapperEl.className = 'dn-inspector-wrapper';
package/src/tree-graph.js CHANGED
@@ -58,7 +58,7 @@ export function TreeGraph(
58
58
  const color = nodeGroup == null ? null : scaleOrdinal(nodeGroups, colors);
59
59
 
60
60
  // Build set of parent-child and sibling navigation rule names.
61
- const parentChildRules = new Set(['parent', 'child']);
61
+ const parentChildRules = new Set(['drill-out', 'drill-in']);
62
62
  const siblingRulePairs = [['left', 'right']]; // default pair
63
63
  if (dimensions) {
64
64
  Object.values(dimensions).forEach(dim => {
package/style.css CHANGED
@@ -62,7 +62,6 @@
62
62
  line-height: 1.3;
63
63
  padding: 2px;
64
64
  margin-top: 4px;
65
- background: #fff;
66
65
  }
67
66
 
68
67
  /* Hidden utility */