GithubHelp home page GithubHelp logo

n0x3u5 / fusionbook Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 5.0 3.46 MB

Develop and test FusionCharts components in isolation

License: MIT License

JavaScript 56.90% HTML 1.81% CSS 5.31% TypeScript 35.99%

fusionbook's Introduction

FusionBook

Develop and test FusionCharts components in isolation

API

import FusionBook, { Story } from 'fusionbook';
import SmartRendererParser from 'fusionbook/smart-renderer.js';
import HTMLParser from 'fusionbook/html.js';
import LegendItem from './legend-item.js';

// Instill the ability to understand SmartRenderer components to FusionBook
FusionBook.registerParser(SmartRendererParser);
FusionBook.registerParser(HTMLParser);

// Creates a story named "Legend Item"
const legendItemStory = new Story('Legend Item');

// Adds a "with defaults" chapter to the story
legendItemStory.addChapter(
  'with defaults',
  story => story.attachChild(LegendItem)
);

// Adds a "with background" chapter to the story
legendItemStory.addChapter(
  'with background',
  story => story.attachChild(LegendItem).configure({ showBackground: true })
);

// Creates a story named "Div Element"
const divStory = new Story('Div Element');

// Adds a "with 50% opacity" chapter to the story
divStory.addChapter(
  'with 50% opacity',
  story => {
    const divElement = document.createElement('div');

    divElement.style.opacity = 0.5;

    story.appendChild(divElement);
  }
);

// export the created stories
export default [legendItemStory, divStory];

CLI

# Starts a server at localhost:3000 with the stories in the given folder
fusionbook --load "path/to/main/stories/file.js"

fusionbook's People

Contributors

n0x3u5 avatar n0x3u5-fc avatar siawo avatar siawo-fc avatar siddharthapaul001 avatar

Stargazers

 avatar

Watchers

 avatar

fusionbook's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.