🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

chemical-pictogram-test

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

chemical-pictogram-test

This package provides a collection of chemical hazard pictograms along with their metadata and SVG content. It allows you to easily retrieve and display chemical hazard information in your applications. The package includes various functions to get all pi

latest
npmnpm
Version
1.0.25
Version published
Maintainers
1
Created
Source

Chemical Pictogram Package

This package provides a collection of chemical hazard pictograms along with their metadata and SVG content. It allows you to easily retrieve and display chemical hazard information in your applications. The package includes various functions to get all pictograms, search for a specific pictogram by name, and filter pictograms based on hazard type.

Installation

To install the package, you can use either npm or yarn. Run one of the following commands in your project directory:

npm install chemical-pictogram-test
# or
yarn add chemical-pictogram-test

Usage

Importing the Package

To use the functionality of the package in your project, import the required functions like so:

 import { getPictograms, findPictograms, searchPictogramsByHazard,PictogramType} from  'chemical-pictogram-test';

1. Get All Pictograms

You can use the getPictograms() function to get an array of all the available pictograms along with their metadata. The returned data includes each pictogram's code, name, hazard type, usage, example (if available), and the associated SVG data as a string.

const pictograms = getPictograms();
console.log(pictograms);

Each object in the returned array will have the following properties:

  • code: The unique identifier of the pictogram (e.g., GHS01).
  • name: The name of the pictogram (e.g., Explosive).
  • hazard_type: The type of hazard that the pictogram represents (e.g., Physical Hazard).
  • usage: A description of how and where the pictogram should be used.
  • example: Optional; an example showing how the pictogram is used.
  • pictogram: The filename of the associated SVG pictogram.
  • usage_exclusion: Optional; exclusions for when the pictogram should not be used.
  • note: Optional; additional notes or clarifications.
  • svgData: The SVG content as a string, which you can use directly in your app.

2. Find a Specific Pictogram by Name

If you're looking for a specific pictogram, you can use the findPictograms() function. You just need to provide the name of the pictogram you're searching for, and it will return the corresponding pictogram object.

const explosivePictogram = findPictograms("Explosive");
console.log(explosivePictogram);

This function will return the pictogram object for the specified name. If no pictogram is found, it will return undefined.

3. Search Pictograms by Hazard Type

To find all pictograms related to a specific hazard type, use the searchPictogramsByHazard() function. You can filter pictograms by their hazard type, such as Physical Hazard, Health Hazard, etc.

const physicalHazardPictograms = searchPictogramsByHazard("Physical");
console.log(physicalHazardPictograms);

This will return an array of pictograms that are categorized under the given hazard type. If no pictograms are found for the specified type, it will return an empty array.

FAQs

Package last updated on 29 Apr 2025

Did you know?

Socket

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.

Install

Related posts