Convert wireframe controls into SVG elements with versatile rendering capabilities for various control types, enabling easy visualization and customization. https://www.npmjs.com/package/roadmap-render
Find a file
2024-01-06 00:00:42 +08:00
.github chore: init 2023-12-06 20:34:27 +08:00
playground feat: add playground 2023-12-07 01:09:16 +08:00
README.assets docs: add readme 2024-01-06 00:00:42 +08:00
src feat: init 2023-12-07 00:39:08 +08:00
test chore: init 2023-12-06 20:34:27 +08:00
.gitignore chore: init 2023-12-06 20:34:27 +08:00
.npmrc chore: init 2023-12-06 20:34:27 +08:00
build.config.ts chore: init 2023-12-06 20:34:27 +08:00
eslint.config.js chore: init 2023-12-06 20:34:27 +08:00
LICENSE chore: init 2023-12-06 20:34:27 +08:00
package.json feat: init 2023-12-07 00:39:08 +08:00
pnpm-lock.yaml feat: init 2023-12-07 00:39:08 +08:00
pnpm-workspace.yaml chore: init 2023-12-06 20:34:27 +08:00
README.md docs: add readme 2024-01-06 00:00:42 +08:00
tsconfig.eslint.json chore: init 2023-12-06 20:34:27 +08:00
tsconfig.json chore: init 2023-12-06 20:34:27 +08:00

Roadmap Render

npm version npm downloads bundle JSDocs License javascript_code style

This project, roadmap-render, is a JavaScript library that enables the conversion of wireframe JSON data into scalable vector graphics (SVG) for rendering roadmaps or visual representations of user interfaces.

image-20240105235921177

Features

Conversion Utilities

  • Decimal Color Conversion: decimalToRGB function to convert decimal color values to their RGB representation.
  • SVG Element Creation: createSVGElement function facilitating the creation of SVG elements with attributes.

Renderer Class

The Renderer class acts as the main component responsible for rendering controls based on the provided wireframe data. It includes methods to render various control types like rectangles, text inputs, arrows, icons, horizontal rules, and grouped elements.

Control Parsing and Rendering

  • Control Parsing: Functions to parse control properties such as color, font styles, and measurements.
  • Rendering Functions: Methods to render different control types by generating corresponding SVG elements.

Wireframe to SVG Conversion

  • wireframeJSONToSVG Function: Converts wireframe JSON data into SVG elements using the provided options, including padding, font family, and font URL.

Usage

To use this library:

  1. Import the necessary functions and classes from the library.
  2. Call the wireframeJSONToSVG function with wireframe data and optional rendering options.
  3. Integrate the resulting SVG element into your application or user interface.

Installation

To install this library, clone the repository and include the necessary files in your project. Ensure to link this library in your HTML files using script tags.

Contributing

We welcome contributions! Please submit issues or pull requests for any enhancements, bug fixes, or new features.

License

MIT License © 2023-PRESENT Kirk Lin