tycho-components 0.2.2-SNAPSHOT-16 → 0.2.3-SNAPSHOT

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.
@@ -4,8 +4,10 @@ type Props = {
4
4
  struct: Struct;
5
5
  expression?: string;
6
6
  selector?: string;
7
- onExpand?: () => void;
8
7
  translations?: Record<string, string>;
8
+ wheelSensitivity?: number;
9
+ onExpand?: () => void;
10
+ onReady?: () => void;
9
11
  };
10
- export default function TreeView({ struct, expression, onExpand, selector, translations, }: Props): import("react/jsx-runtime").JSX.Element;
12
+ export default function TreeView({ struct, expression, selector, translations, wheelSensitivity, onExpand, onReady, }: Props): import("react/jsx-runtime").JSX.Element;
11
13
  export {};
@@ -10,7 +10,7 @@ import SyntreesCytoscape from './cytoscape/SyntreesCytoscape';
10
10
  import './style.scss';
11
11
  import AppPlaceholder from '../AppPlaceholder';
12
12
  import DateUtils from '../functions/DateUtils';
13
- export default function TreeView({ struct, expression, onExpand, selector = 'canvas-tree', translations, }) {
13
+ export default function TreeView({ struct, expression, selector = 'canvas-tree', translations, wheelSensitivity, onExpand, onReady, }) {
14
14
  const { t } = useTranslation('tree');
15
15
  const [cy, setCy] = useState(null);
16
16
  const [showInfo, setShowInfo] = useState(false);
@@ -37,8 +37,10 @@ export default function TreeView({ struct, expression, onExpand, selector = 'can
37
37
  SyntreesCytoscape.init({
38
38
  selector,
39
39
  tree,
40
+ wheelSensitivity,
40
41
  onReady: (thisCy) => {
41
42
  setCy(thisCy);
43
+ onReady && onReady();
42
44
  },
43
45
  });
44
46
  };
@@ -5,9 +5,10 @@ type Props = {
5
5
  tree: CytoscapeTree;
6
6
  stylesheet?: cytoscape.StylesheetCSS[];
7
7
  dagre?: boolean;
8
+ wheelSensitivity?: number;
8
9
  onReady?: (cy: Core) => void;
9
10
  };
10
11
  declare const SyntreesCytoscape: {
11
- init: ({ selector, tree, dagre, stylesheet, onReady, }: Props) => Core;
12
+ init: ({ selector, tree, dagre, stylesheet, wheelSensitivity, onReady, }: Props) => Core;
12
13
  };
13
14
  export default SyntreesCytoscape;
@@ -1,6 +1,6 @@
1
1
  import cytoscape from 'cytoscape';
2
2
  import defaultStylesheet from './CytoscapeStylesheet';
3
- const init = ({ selector, tree, dagre = false, stylesheet = defaultStylesheet, onReady, }) => {
3
+ const init = ({ selector, tree, dagre = false, stylesheet = defaultStylesheet, wheelSensitivity = 1.5, onReady, }) => {
4
4
  destroy(selector);
5
5
  const cy = cytoscape({
6
6
  container: document.getElementById(selector),
@@ -28,7 +28,7 @@ const init = ({ selector, tree, dagre = false, stylesheet = defaultStylesheet, o
28
28
  textureOnViewport: false,
29
29
  motionBlur: false,
30
30
  motionBlurOpacity: 0.2,
31
- wheelSensitivity: 1.5,
31
+ wheelSensitivity,
32
32
  pixelRatio: 1,
33
33
  });
34
34
  cy.ready(() => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.2.2-SNAPSHOT-16",
4
+ "version": "0.2.3-SNAPSHOT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {