Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kennethanceyer/formulize

:waning_crescent_moon: formula ui generator
https://github.com/kennethanceyer/formulize

calculate component expression formula javascript libary parser wysiwyg

Last synced: about 8 hours ago
JSON representation

:waning_crescent_moon: formula ui generator

Awesome Lists containing this project

README

        

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

## :package: Installation

#### git

```bash
$ git clone [email protected]:KennethanCeyer/formulize
```

#### npm

```bash
$ npm install formulize
```

### yarn

```bash
$ yarn add formulize
```

## :clap: Getting started

This plugin helps you to make formulas WYSWYG UI

> this plugin is based [metric-parser](https://github.com/KennethanCeyer/metric-parser)

[demo page](http://www.pigno.se/barn/PIGNOSE-Formula)

![Sample screen](http://www.pigno.se/barn/PIGNOSE-Formula/demo/img/screenshot_main.png)

## :page_with_curl: Example (basic)

```html


```

If you want to make UI into `#formulize`

#### typescript

```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)

```javascript
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

```javascript
$(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](https://app.fossa.io/api/projects/git%2Bgithub.com%2FKennethanCeyer%2Fformulize.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FKennethanCeyer%2Fformulize?ref=badge_large)

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.