Giter VIP home page Giter VIP logo

cgview-js's People

Contributors

clovisnorroy avatar sciguy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

hasihays

cgview-js's Issues

1 bp features are not displayed

Hi,
I am currently trying to display Single Nucleotide Polymorphisms but it doesn't seems currently possible to display features of less than 2 bp.
Furthermore, labels for 1 bp features are displayed but placed between 2 bp on the backbone, making it impossible to know which nucleotide is targeted.
image

Change the Labels font color

Hello, I want to make the Labels font color correspond to its feature color, here is my code:
image
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!
image

Linear visualization not working

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>

image

Bests,

Alejandra

I'm not sure if it's a data issue, please take a look

20231026-194403
20231026-194359
Keep scrolling the mouse in the direction of the red arrow to zoom in, and misalignment will occur.

In addition, I would like to ask, after I modify the sequence and redraw it, how can I maintain the current zoom ratio and movement position? Can you provide some ideas? Thanks

Identify the newly added information in json

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:

image

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

image

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!

Error "SyntaxError: Cannot use import statement outside a module" when importing CGView ESM

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.

SVG export

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 ?

Show more content

I'm showing you a little bit now, I want to show you a little bit more so how do I change the code, or where do I change the code? Like the picture below:
CGV

Error "d3 is not defined" when importing from IIFE

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 ).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.