Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including formulize with all npm packages installed. Try it out:

var formulize = require("formulize")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

formulize v0.0.13

formula UI generator

formulize :waxing_crescent_moon:

formula UI generator

NPM

npm version Join the chat at https://gitter.im/KennethanCeyer/PIGNOSE GitHub stars GitHub license

Build Status codecov Coverage Status Test Coverage

Maintainability CodeFactor dependencies Status devDependencies Status

:package: Installation

git

$ git clone git@github.com:KennethanCeyer/formulize

npm

$ npm install formulize

yarn

$ yarn add formulize

:clap: Getting started

This plugin helps you to make formulas WYSWYG UI

this plugin is based metric-parser

demo page

Sample screen

:page_with_curl: Example (basic)

<div id="formulize"></div>

If you want to make UI into #formulize

typescript

import { UI } from 'formulize';

const target = document.getElementById('formulize');
const formulize = new UI(target, {
    ...options
});

const data: Tree = {
    operator: '*',
    operand1: { value: { type: 'unit', unit: 1 } },
    operand2: { value: { type: 'unit', unit: 2 } }
};

formulize.setData(data);

javascript (ES6)

import { UI } from 'formulize';

const target = document.getElementById('formulize');
const formulize = new UI(target, {
    ...options
});

const data = {
    operator: '*',
    operand1: { value: { type: 'unit', unit: 1 } },
    operand2: { value: { type: 'unit', unit: 2 } }
};

formulize.setData(data);

jQuery

$(function() {
    $('#formulize').formulize({
        ...options
    });

    const formulize = $('#formulize').data('$formulize');
    const data = {
        operator: '*',
        operand1: { value: { type: 'unit', unit: 1 } },
        operand2: { value: { type: 'unit', unit: 2 } }
    };

    formulize.setData(data);

    // unrecommended way
    $('#formulize').setData(data);
});

:triangular_flag_on_post: Roadmap

  • [x] support typescript
  • [x] update formula tree parser
  • [x] support reference docs
  • [x] follow clean code philosophy
  • [x] follow object based implementation
  • [x] support UMD module
  • [x] support code qualify tool
  • [x] support automation test environment
  • [x] support scss style file
  • [ ] support multiple themes
  • [ ] support unit code to achieve coverage over 90%
  • [ ] support integration testing with mocking dom in the code-level
  • [ ] support e2e testing
  • [ ] add guideline in Github WIKI
  • [ ] add guideline snippet gist and jsfiddle
  • [ ] add contributor guidelines
  • [ ] support cdn

:mag: License

FOSSA Status

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free