@jbrowse/react-circular-genome-view2 3.2.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.
Files changed (64) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +75 -0
  3. package/dist/JBrowseCircularGenomeView/JBrowseCircularGenomeView.d.ts +5 -0
  4. package/dist/JBrowseCircularGenomeView/JBrowseCircularGenomeView.js +23 -0
  5. package/dist/JBrowseCircularGenomeView/index.d.ts +1 -0
  6. package/dist/JBrowseCircularGenomeView/index.js +8 -0
  7. package/dist/corePlugins.d.ts +3 -0
  8. package/dist/corePlugins.js +22 -0
  9. package/dist/createModel/AboutDialog.d.ts +1 -0
  10. package/dist/createModel/AboutDialog.js +5 -0
  11. package/dist/createModel/createConfigModel.d.ts +104 -0
  12. package/dist/createModel/createConfigModel.js +43 -0
  13. package/dist/createModel/createModel.d.ts +1387 -0
  14. package/dist/createModel/createModel.js +117 -0
  15. package/dist/createModel/createSessionModel.d.ts +260 -0
  16. package/dist/createModel/createSessionModel.js +115 -0
  17. package/dist/createModel/index.d.ts +3 -0
  18. package/dist/createModel/index.js +12 -0
  19. package/dist/createViewState.d.ts +3780 -0
  20. package/dist/createViewState.js +64 -0
  21. package/dist/index.d.ts +4 -0
  22. package/dist/index.js +14 -0
  23. package/dist/loadPlugins.d.ts +13 -0
  24. package/dist/loadPlugins.js +12 -0
  25. package/dist/react-circular-genome-view.umd.production.min.js +185 -0
  26. package/dist/react-circular-genome-view.umd.production.min.js.LICENSE.txt +141 -0
  27. package/dist/react-circular-genome-view.umd.production.min.js.map +1 -0
  28. package/dist/types.d.ts +5 -0
  29. package/dist/types.js +2 -0
  30. package/dist/version.d.ts +1 -0
  31. package/dist/version.js +4 -0
  32. package/dist/webpack.d.ts +7 -0
  33. package/dist/webpack.js +53 -0
  34. package/docs/example.md +105 -0
  35. package/docs/img/exampleView.png +0 -0
  36. package/esm/JBrowseCircularGenomeView/JBrowseCircularGenomeView.d.ts +5 -0
  37. package/esm/JBrowseCircularGenomeView/JBrowseCircularGenomeView.js +21 -0
  38. package/esm/JBrowseCircularGenomeView/index.d.ts +1 -0
  39. package/esm/JBrowseCircularGenomeView/index.js +1 -0
  40. package/esm/corePlugins.d.ts +3 -0
  41. package/esm/corePlugins.js +17 -0
  42. package/esm/createModel/AboutDialog.d.ts +1 -0
  43. package/esm/createModel/AboutDialog.js +1 -0
  44. package/esm/createModel/createConfigModel.d.ts +104 -0
  45. package/esm/createModel/createConfigModel.js +37 -0
  46. package/esm/createModel/createModel.d.ts +1387 -0
  47. package/esm/createModel/createModel.js +78 -0
  48. package/esm/createModel/createSessionModel.d.ts +260 -0
  49. package/esm/createModel/createSessionModel.js +76 -0
  50. package/esm/createModel/index.d.ts +3 -0
  51. package/esm/createModel/index.js +3 -0
  52. package/esm/createViewState.d.ts +3780 -0
  53. package/esm/createViewState.js +58 -0
  54. package/esm/index.d.ts +4 -0
  55. package/esm/index.js +4 -0
  56. package/esm/loadPlugins.d.ts +13 -0
  57. package/esm/loadPlugins.js +6 -0
  58. package/esm/types.d.ts +5 -0
  59. package/esm/types.js +1 -0
  60. package/esm/version.d.ts +1 -0
  61. package/esm/version.js +1 -0
  62. package/esm/webpack.d.ts +7 -0
  63. package/esm/webpack.js +7 -0
  64. package/package.json +68 -0
@@ -0,0 +1,58 @@
1
+ import { autorun } from 'mobx';
2
+ import { onPatch } from 'mobx-state-tree';
3
+ import createModel from './createModel';
4
+ export default function createViewState(opts) {
5
+ const { assembly, tracks, internetAccounts, configuration, aggregateTextSearchAdapters, plugins, makeWorkerInstance, onChange, } = opts;
6
+ const { model, pluginManager } = createModel(plugins || [], makeWorkerInstance);
7
+ let { defaultSession } = opts;
8
+ if (!defaultSession) {
9
+ defaultSession = {
10
+ name: 'this session',
11
+ view: {
12
+ id: 'circularView',
13
+ type: 'CircularView',
14
+ },
15
+ };
16
+ }
17
+ const stateSnapshot = {
18
+ config: {
19
+ configuration,
20
+ assembly,
21
+ tracks,
22
+ internetAccounts,
23
+ aggregateTextSearchAdapters,
24
+ defaultSession,
25
+ },
26
+ session: defaultSession,
27
+ };
28
+ const stateTree = model.create(stateSnapshot, { pluginManager });
29
+ for (const account of stateTree.config.internetAccounts) {
30
+ const internetAccountType = pluginManager.getInternetAccountType(account.type);
31
+ if (!internetAccountType) {
32
+ throw new Error(`unknown internet account type ${account.type}`);
33
+ }
34
+ stateTree.addInternetAccount({
35
+ type: account.type,
36
+ configuration: account,
37
+ });
38
+ }
39
+ pluginManager.setRootModel(stateTree);
40
+ pluginManager.configure();
41
+ autorun(reaction => {
42
+ var _a;
43
+ const { session, assemblyManager } = stateTree;
44
+ if (!session.view.initialized) {
45
+ return;
46
+ }
47
+ const regions = (_a = assemblyManager.get(assembly === null || assembly === void 0 ? void 0 : assembly.name)) === null || _a === void 0 ? void 0 : _a.regions;
48
+ if (!regions) {
49
+ return;
50
+ }
51
+ session.view.setDisplayedRegions(regions);
52
+ reaction.dispose();
53
+ });
54
+ if (onChange) {
55
+ onPatch(stateTree, onChange);
56
+ }
57
+ return stateTree;
58
+ }
package/esm/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export { default as JBrowseCircularGenomeView } from './JBrowseCircularGenomeView';
2
+ export { default as createModel } from './createModel';
3
+ export { default as createViewState } from './createViewState';
4
+ export { default as loadPlugins } from './loadPlugins';
package/esm/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export { default as JBrowseCircularGenomeView } from './JBrowseCircularGenomeView';
2
+ export { default as createModel } from './createModel';
3
+ export { default as createViewState } from './createViewState';
4
+ export { default as loadPlugins } from './loadPlugins';
@@ -0,0 +1,13 @@
1
+ import type { LoadedPlugin } from '@jbrowse/core/PluginLoader';
2
+ interface PluginDefinition {
3
+ name: string;
4
+ url: string;
5
+ }
6
+ export default function loadPlugins(pluginDefinitions: PluginDefinition[], args?: {
7
+ fetchESM?: (url: string) => Promise<LoadedPlugin>;
8
+ baseUrl?: string;
9
+ }): Promise<{
10
+ plugin: import("@jbrowse/core/Plugin").PluginConstructor;
11
+ definition: import("@jbrowse/core/PluginLoader").PluginDefinition;
12
+ }[]>;
13
+ export {};
@@ -0,0 +1,6 @@
1
+ import PluginLoader from '@jbrowse/core/PluginLoader';
2
+ export default async function loadPlugins(pluginDefinitions, args) {
3
+ const pluginLoader = new PluginLoader(pluginDefinitions, args);
4
+ pluginLoader.installGlobalReExports(window);
5
+ return pluginLoader.load(args === null || args === void 0 ? void 0 : args.baseUrl);
6
+ }
package/esm/types.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import type { IAnyStateTreeNode } from 'mobx-state-tree';
2
+ export interface ReferringNode {
3
+ node: IAnyStateTreeNode;
4
+ key: string;
5
+ }
package/esm/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export const version: "3.2.0";
package/esm/version.js ADDED
@@ -0,0 +1 @@
1
+ export const version = '3.2.0';
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ export { default as JBrowseCircularGenomeView } from './JBrowseCircularGenomeView';
3
+ export { default as createModel } from './createModel';
4
+ export { default as createViewState } from './createViewState';
5
+ export { default as loadPlugins } from './loadPlugins';
6
+ export * from 'react-dom/client';
7
+ export { React };
package/esm/webpack.js ADDED
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ export { default as JBrowseCircularGenomeView } from './JBrowseCircularGenomeView';
3
+ export { default as createModel } from './createModel';
4
+ export { default as createViewState } from './createViewState';
5
+ export { default as loadPlugins } from './loadPlugins';
6
+ export * from 'react-dom/client';
7
+ export { React };
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@jbrowse/react-circular-genome-view2",
3
+ "version": "3.2.0",
4
+ "description": "JBrowse 2 circular genome view React component",
5
+ "keywords": [
6
+ "jbrowse",
7
+ "jbrowse2"
8
+ ],
9
+ "license": "MIT",
10
+ "homepage": "https://jbrowse.org",
11
+ "bugs": "https://github.com/GMOD/jbrowse-components/issues",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/GMOD/jbrowse-components.git",
15
+ "directory": "products/jbrowse-react-circular-genome-view"
16
+ },
17
+ "author": "JBrowse Team",
18
+ "main": "dist/index.js",
19
+ "module": "esm/index.js",
20
+ "files": [
21
+ "dist",
22
+ "esm",
23
+ "docs"
24
+ ],
25
+ "scripts": {
26
+ "prebuild": "npm run clean",
27
+ "build": "npm-run-all build:*",
28
+ "prepublishOnly": "node output-version.js > src/version.js && git add -A src && git commit -m '[skip ci] Bump version.js'",
29
+ "prepack": "npm run build",
30
+ "build:esm": "tsc -b tsconfig.build.esm.json",
31
+ "build:commonjs": "tsc -b tsconfig.build.commonjs.json",
32
+ "build:webpack": "webpack",
33
+ "clean": "rimraf esm dist *.tsbuildinfo",
34
+ "storybook": "storybook dev --port 6006",
35
+ "storybook:build": "storybook build"
36
+ },
37
+ "dependencies": {
38
+ "@babel/runtime": "^7.17.9",
39
+ "@emotion/cache": "^11.7.1",
40
+ "@emotion/react": "^11.9.0",
41
+ "@emotion/styled": "^11.8.1",
42
+ "@jbrowse/core": "^3.2.0",
43
+ "@jbrowse/embedded-core": "^3.2.0",
44
+ "@jbrowse/plugin-authentication": "^3.2.0",
45
+ "@jbrowse/plugin-circular-view": "^3.2.0",
46
+ "@jbrowse/plugin-config": "^3.2.0",
47
+ "@jbrowse/plugin-data-management": "^3.2.0",
48
+ "@jbrowse/plugin-linear-genome-view": "^3.2.0",
49
+ "@jbrowse/plugin-sequence": "^3.2.0",
50
+ "@jbrowse/plugin-variants": "^3.2.0",
51
+ "@jbrowse/plugin-wiggle": "^3.2.0",
52
+ "@jbrowse/product-core": "^3.2.0",
53
+ "@mui/icons-material": "^6.0.0",
54
+ "@mui/material": "^6.0.0",
55
+ "mobx": "^6.6.0",
56
+ "mobx-react": "^9.0.0",
57
+ "mobx-state-tree": "^5.0.0",
58
+ "rxjs": "^7.0.0",
59
+ "tss-react": "^4.4.1"
60
+ },
61
+ "peerDependencies": {
62
+ "react": ">=18.0.0"
63
+ },
64
+ "publishConfig": {
65
+ "access": "public"
66
+ },
67
+ "gitHead": "c750e3f56706a490c19ba75abd807fec5e38aebf"
68
+ }