
Product
Reachability for Ruby Now in Beta
Reachability analysis for Ruby is now in beta, helping teams identify which vulnerabilities are truly exploitable in their applications.
in development
A live example is available to play with at https://ebi-metagenomics.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';
legacy browsers support (including Internet Explorer)
To support IE, or other legacy browsers, you can use the legacy bundle which
includes a set of needed polyfills. It has only been tested back to IE10, and it
will probably break on previous versions of IE.
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 -> colorv_align -> vAlignstart: integer, display: booleandataFAQs
Domain graphics drawing library
We found that domain-gfx demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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.

Product
Reachability analysis for Ruby is now in beta, helping teams identify which vulnerabilities are truly exploitable in their applications.

Research
/Security News
Malicious npm packages use Adspect cloaking and fake CAPTCHAs to fingerprint visitors and redirect victims to crypto-themed scam sites.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.