stothard-group / cgview-js Goto Github PK
View Code? Open in Web Editor NEWCGView.js creates interactive circular and linear genome maps.
Home Page: https://js.cgview.ca
CGView.js creates interactive circular and linear genome maps.
Home Page: https://js.cgview.ca
"gc-content gc-skew" has not been drawn to the maximum magnification. After completion, the sequence gap will be very large, and then it will go blank after moving it. Your demo will also have this problem.
And even if it is not maximized, after "gc-content gc-skew" is completed, the canvas will appear or be partially offset.
The documentation says:Capable of drawing genomes up to 10 Mbp with 1000's of features and 100's contigs
If there are 20 million data and 20,000 features, will there be any problems?
Thanks
Hello, I want to make the Labels font color correspond to its feature color, here is my code:
I give each label a color iteratively and print the _rgbaString property on the console to make sure it has been given a color, but why is the label font color on the page still black? Nothing has changed, please help me! Thanks!
A two-point pinch gesture zooms but the zoom position is not located at the touch site (unlike when zooming is done using the mouse pointer). This link provides a demo where pinch zooming works well.
Hi! Thanks for the amazing tool.
I'm just trying to visualize a linear structure by adding the attribute 'format': 'linear'
to settings
, but still render as circular. I would appreciate any help.
<!-- CG VIEWER -->
<script type="module">
import cgview from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm';
var cgv = new CGV.Viewer('#my-viewer', {
height: 800,
width: 1000
});
json = {'cgview': {'features': [{'legend': 'Virulence',
'name': 'IncX5_2, MF062700, ',
'source': 'json-feature',
'start': 129,
'stop': 704,
'type': 'CDS'}],
'legend': {'items': [{'decoration': 'arrow',
'name': 'CDS',
'swatchColor': 'rgb(111,187,111)'},
{'decoration': 'arrow',
'name': 'Virulence',
'swatchColor': 'rgb(118,84,154)'},
{'decoration': 'arrow',
'name': 'BGC',
'swatchColor': 'rgb(255,159,64)'},
{'decoration': 'arrow',
'name': 'Other',
'swatchColor': 'rgb(81,160,238)'}]},
'sequence': {'length': 47656},
'settings': {'arrowHeadLength': 0.3,
'backgroundColor': 'white',
'format': 'linear',
'showShading': 'true'},
'tracks': [{'dataKeys': 'json-feature',
'dataMethod': 'source',
'dataType': 'feature',
'name': 'Features'}],
'version': '1.1.0'}}
json = json.replace(/'/g, '"');
// Load the JSON
cgv.io.loadJSON(json);
cgv.draw();
</script>
Bests,
Alejandra
Hello, I got the json file I wanted by modifying the cgview_builder.rb script, below is a screenshot of my json file, cog and translation information in features was added by me manually:
Now I have a problem, after the json file is loaded into cgv, it cannot recognize the new json information I added, such as cog and translation information cannot be recognized
The content of ${feature-cog} is undefined, I tried to modify the cgview.esm.js file, but I did not know where to modify it, may I ask what I should do? Thanks!
I'm getting the error SyntaxError: Cannot use import statement outside a module
@ .../node_modules/cgview/dist/cgview.esm.js (9)
when trying to import CGView from ESM and run the starter code shown below within a NextJS App(version 13.4.4)
code:
import CGV from 'cgview';
export const SchemaPlasmidMap = new CGV.Viewer('#my-viewer', {
height: 500,
width: 500,
sequence: {
// The length of the sequence
length: 1000,
},
});
Also unable to import using IIFE– created a separate ticket #9 for that as well.
Zooming in on a circular view and switching to a linear view routinely yields a blank map.
Hello,
The old CGView allowed to export genomes in SVG format which is convenient for instance to edit the map for publications. Is it possible to add this feature ?
I'm trying to use CGView in a NextJS(version 13.4.4) app, and getting the error d3 is not defined (at .../node_modules/cgview/dist/cgview.js (19502:7)
from the following code.
import CGV from 'cgview/dist/cgview.js';
export const SchemaPlasmidMap = new CGV.Viewer('#my-viewer', {
height: 500,
width: 500,
sequence: {
// The length of the sequence
length: 1000,
},
});
I've confirmed that d3
was installed within the cgview
node modules.
When trying to import from the ESM, I get a different error from within CGView (#10 ).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.