
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
graphane-workbench
Advanced tools
The Graphane Workbench is an integrated environment designed to help developers and designers perform simulations, visualizations, and case analyses based on the Graphane micro-framework and other related libraries.
This workbench provides an easy-to-use platform for creating test cases and examples, making interactive components and visualizations straightforward while supporting advanced features like event handling and dynamic scripting.
Before installing the package, make sure that:
To install the Workbench, use the following command in your terminal:
npm i @graphane/workbench
This will download and install the @graphane/workbench
package using the Node Package Manager
(npm).
The Graphane Workbench allows you to define cases programmatically using JavaScript modules. A typical case includes a title, description, HTML content, and optional logic or event handling.
The g-workshop
tool comes with various options and features, allowing you to configure and run it
effectively. Below is the usage guide for its supported commands and options.
g-workshop [options]
Option | Description |
---|---|
**-V, --version ** | Outputs the version number of the tool. |
**-l, --label <title> ** | Specifies a title label. |
**-t, --test <cases-folder> ** | Folder containing test case files (.js files). |
**-r, --root <root-folder> ** | Sets the root folder to be served. |
**-p, --port <server-port> ** | Specifies the HTTP server port. |
**-i, --import <module...> ** | Imports one or more specified modules. |
**-b, --lib <library...> ** | Imports one or more specified libraries. |
**-s, --silence ** | Enables silence mode (suppresses output). |
**-h, --help ** | Displays the help information for the command. |
Below is the structure of a basic case definition in a JavaScript file:
export const title = 'title';
export const description = `description`;
export default `<!-- HTML Content -->`;
export const title = 'title';
:export const description = \
description`;`:export default \
content`;`:export script() {}
:export const events = true;
export const events = ['event-name'];
to add events
handled.This example renders a simple SVG file using a g-composer
component.
export const title = '1) Simple example';
export const description = `Display a svg file`;
export default `
<g-composer svg-src="/test/component/composer/assets/image.svg"
style="width: 200px; height: 200px;">
</g-composer>
`;
This example demonstrates a case where the visibility of the g-composer
component can be toggled
dynamically using a button.
export const title = '2) Size: hide and component';
export const description = 'Start with display none and component size by css';
export function script () {
const container = document.querySelector('#container');
const show = document.querySelector('#run');
show.addEventListener('click', () => {
if (container.style.display) {
container.style.display = '';
show.innerHTML = 'hide';
} else {
container.style.display = 'none';
show.innerHTML = 'show';
}
});
}
export default `
<div id="container" style="display:none">
<g-composer style="width: 250px">
<svg viewBox="0 0 100 100">
<rect x="0" y="0" width="100" height="100" fill="red"/>
</svg>
</g-composer>
</div>
<button id="run">show</button>
`;
An advanced example demonstrating event handling for a g-composer
component. This case listens for
the intersection.enter
event when the element becomes fully visible in the viewport.
export const title = '3) Handle events';
export const description = 'You can capture with <code>addEventListener</code> the regular events for Graphane Components and HTMLElements.';
export const events = ['intersection.enter'];
export default `
<g-composer svg-src="/test/component/composer/assets/check.svg"
intersection-ratio="1"
style="width: 50px;">
</g-composer>
`;
FAQs
Graphane Workbench
The npm package graphane-workbench receives a total of 5 weekly downloads. As such, graphane-workbench popularity was classified as not popular.
We found that graphane-workbench demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.