
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
in development
A live example is available to play with at https://proteinswebteam.github.io/domain_gfx/
This library is available on npm, to install it run:
npm install --save domain-gfx
Otherwise, you can use it directly from the unpkg CDN at
https://unpkg.com/domain-gfx
recommended way
This library is available as a plain ES module, you can use it directly by importing it into your code like this:
import DomainGfx from 'domain-gfx';
you can insert the script in your page, synchronously or not. It will
add the global DomainGfx
.
If you are loading it asynchronously, you can listen for the
'domainGfxReady'
event on the document
, containing the DomainGfx
class. e.g.:
document.addEventListener('domainGfxReady', event => {
const DomainGfx = event.detail;
// Use the DomainGfx class...
// ...
});
From the dist
folder, use the domain_gfx.es5.js
file, for ES5
support, or domain_gfx.es2015.js
, for ES2015 support.
new DomainGfx(userParameters);
userParameters, object
: contains information to render the graphic
parent, Element
: container element for the graphic
data, optional object
: data describing the content of the
graphic
params, optional object
: extra parameters, modifying the
rendering (not used at the moment) like the scale of the image, or
default sizes
A new instance of DomainGfx
DomainGfx.prototype.data getter data(): returns the internal data stored in the instance
DomainGfx.prototype.data setter data(value): sanitize value, and sets the result as internal data and returns it
// DOM container
const parent = document.querySelector('.container');
// Domain graphics data object (see data syntax section)
const data = {
length: 100,// sequence of length 400
regions: [// array of sequence objects
{
text: 'domain name',
start: 2,
end: 40,
aliStart: 5,// >= start
aliEnd: 30,// <= end
display: true,
startStyle: 'jagged',
endStyle: 'curved',
color: 'blue'
metadata: {// information for tooltip
database: 'pfam',
description: 'text about the domain',
accession: 'PF00000',
identifier: 'domain X',
},
},
],
markups: [// array of markup objects
{
lineColour: '#0ff0f0',
colour: '#bb5b55',
display: true,
vAlign: 'top',
type: 'Pfam predicted active site',
start: 5,
headStyle: 'diamond',
metadata: {
database: 'pfam',
description: 'S Pfam predicted active site',
},
},
],
motifs: [// array of motif objects
{
colour: '#00a500',
metadata: true,
database: 'Phobius',
type: 'sig_p',
display: true,
end: 50,
start: 30
},
],
};
const dg = new DomainGfx({data, parent});
As compared to pre-existing older libraries such as PfamGraphics
instead of passing as different parameters, first a node or a string
to select a node, then an object with all the data, this now expects
an object with a parent
, and optional data
and params
keys.
instead of calling the render method afterwards on the DomainGfx object, the render is done automatically when instantiating the object, and also everytime different data is assigned to the object.
Old data objects should still be able to be used, as this library still accounts for the old formats. If it is not able to use the data please upgrade the data object to a newer version.
Should be used:
colour
-> color
v_align
-> vAlign
start
: integer, display
: booleandata
FAQs
Domain graphics drawing library
The npm package domain-gfx receives a total of 11 weekly downloads. As such, domain-gfx popularity was classified as not popular.
We found that domain-gfx demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.