@jbrowse/plugin-circular-view 3.6.4 → 3.7.0

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.
@@ -45,7 +45,7 @@ const ElisionRulerArc = (0, mobx_react_1.observer)(function ({ model, slice, reg
45
45
  const widthPx = (endRadians - startRadians) * radiusPx;
46
46
  const largeArc = endRadians - startRadians > Math.PI ? '1' : '0';
47
47
  const centerRadians = (endRadians + startRadians) / 2;
48
- const regionCount = `[${Number(region.regions.length).toLocaleString()}]`;
48
+ const regionCount = `[${region.regions.length.toLocaleString()}]`;
49
49
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(RulerLabel, { text: regionCount, view: model, maxWidthPx: widthPx, radians: centerRadians, radiusPx: radiusPx, title: `${regionCount} more regions`, color: theme.palette.text.primary }), (0, jsx_runtime_1.jsx)("path", { d: [
50
50
  'M',
51
51
  ...startXY,
@@ -64,17 +64,19 @@ const RulerLabel = (0, mobx_react_1.observer)(function ({ view, text, maxWidthPx
64
64
  if (!text) {
65
65
  return null;
66
66
  }
67
- if (text.length * 6.5 < maxWidthPx) {
68
- return ((0, jsx_runtime_1.jsxs)("text", { x: 0, y: 0, className: classes.rulerLabel, textAnchor: "middle", dominantBaseline: "baseline", transform: `translate(${textXY}) rotate(${(0, util_1.radToDeg)(radians) + 90})`, ...(0, util_1.getFillProps)(color), children: [text, (0, jsx_runtime_1.jsx)("title", { children: title || text })] }));
67
+ else if (text.length * 6.5 < maxWidthPx) {
68
+ return ((0, jsx_runtime_1.jsxs)("text", { x: 0, y: 0, className: classes.rulerLabel, textAnchor: "middle", dominantBaseline: "middle", transform: `translate(${textXY}) rotate(${(0, util_1.radToDeg)(radians) + 90})`, ...(0, util_1.getFillProps)(color), children: [text, (0, jsx_runtime_1.jsx)("title", { children: title || text })] }));
69
69
  }
70
- if (maxWidthPx > 4) {
70
+ else if (maxWidthPx > 4) {
71
71
  const overallRotation = (0, util_1.radToDeg)(radians + view.offsetRadians - Math.PI / 2);
72
72
  if (overallRotation >= 180) {
73
73
  return ((0, jsx_runtime_1.jsxs)("text", { x: 0, y: 0, className: classes.rulerLabel, textAnchor: "start", dominantBaseline: "middle", transform: `translate(${textXY}) rotate(${(0, util_1.radToDeg)(radians)})`, fill: color, children: [text, (0, jsx_runtime_1.jsx)("title", { children: title || text })] }));
74
74
  }
75
75
  return ((0, jsx_runtime_1.jsxs)("text", { x: 0, y: 0, className: classes.rulerLabel, textAnchor: "end", dominantBaseline: "middle", transform: `translate(${textXY}) rotate(${(0, util_1.radToDeg)(radians) + 180})`, fill: color, children: [text, (0, jsx_runtime_1.jsx)("title", { children: title || text })] }));
76
76
  }
77
- return null;
77
+ else {
78
+ return null;
79
+ }
78
80
  });
79
81
  const RegionRulerArc = (0, mobx_react_1.observer)(function ({ model, slice, region, }) {
80
82
  const theme = (0, styles_1.useTheme)();
@@ -43,7 +43,7 @@ const ElisionRulerArc = observer(function ({ model, slice, region, }) {
43
43
  const widthPx = (endRadians - startRadians) * radiusPx;
44
44
  const largeArc = endRadians - startRadians > Math.PI ? '1' : '0';
45
45
  const centerRadians = (endRadians + startRadians) / 2;
46
- const regionCount = `[${Number(region.regions.length).toLocaleString()}]`;
46
+ const regionCount = `[${region.regions.length.toLocaleString()}]`;
47
47
  return (_jsxs(_Fragment, { children: [_jsx(RulerLabel, { text: regionCount, view: model, maxWidthPx: widthPx, radians: centerRadians, radiusPx: radiusPx, title: `${regionCount} more regions`, color: theme.palette.text.primary }), _jsx("path", { d: [
48
48
  'M',
49
49
  ...startXY,
@@ -62,17 +62,19 @@ const RulerLabel = observer(function ({ view, text, maxWidthPx, radians, radiusP
62
62
  if (!text) {
63
63
  return null;
64
64
  }
65
- if (text.length * 6.5 < maxWidthPx) {
66
- return (_jsxs("text", { x: 0, y: 0, className: classes.rulerLabel, textAnchor: "middle", dominantBaseline: "baseline", transform: `translate(${textXY}) rotate(${radToDeg(radians) + 90})`, ...getFillProps(color), children: [text, _jsx("title", { children: title || text })] }));
65
+ else if (text.length * 6.5 < maxWidthPx) {
66
+ return (_jsxs("text", { x: 0, y: 0, className: classes.rulerLabel, textAnchor: "middle", dominantBaseline: "middle", transform: `translate(${textXY}) rotate(${radToDeg(radians) + 90})`, ...getFillProps(color), children: [text, _jsx("title", { children: title || text })] }));
67
67
  }
68
- if (maxWidthPx > 4) {
68
+ else if (maxWidthPx > 4) {
69
69
  const overallRotation = radToDeg(radians + view.offsetRadians - Math.PI / 2);
70
70
  if (overallRotation >= 180) {
71
71
  return (_jsxs("text", { x: 0, y: 0, className: classes.rulerLabel, textAnchor: "start", dominantBaseline: "middle", transform: `translate(${textXY}) rotate(${radToDeg(radians)})`, fill: color, children: [text, _jsx("title", { children: title || text })] }));
72
72
  }
73
73
  return (_jsxs("text", { x: 0, y: 0, className: classes.rulerLabel, textAnchor: "end", dominantBaseline: "middle", transform: `translate(${textXY}) rotate(${radToDeg(radians) + 180})`, fill: color, children: [text, _jsx("title", { children: title || text })] }));
74
74
  }
75
- return null;
75
+ else {
76
+ return null;
77
+ }
76
78
  });
77
79
  const RegionRulerArc = observer(function ({ model, slice, region, }) {
78
80
  const theme = useTheme();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-circular-view",
3
- "version": "3.6.4",
3
+ "version": "3.7.0",
4
4
  "description": "JBrowse 2 circular view",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -36,7 +36,7 @@
36
36
  "clean": "rimraf dist esm *.tsbuildinfo"
37
37
  },
38
38
  "dependencies": {
39
- "@jbrowse/core": "^3.6.4",
39
+ "@jbrowse/core": "^3.7.0",
40
40
  "@mui/icons-material": "^7.0.0",
41
41
  "@mui/material": "^7.0.0",
42
42
  "@types/file-saver": "^2.0.0",
@@ -56,5 +56,5 @@
56
56
  "distModule": "esm/index.js",
57
57
  "srcModule": "src/index.ts",
58
58
  "module": "esm/index.js",
59
- "gitHead": "3db8e50ce2bd9c081efbf6c2e7ae5f342380a25a"
59
+ "gitHead": "85bdd0d58286b7adbfd408146b15847676317635"
60
60
  }