Skip to content

Commit c627681

Browse files
authored
docs: update readme desc (#29)
* docs: update readme desc * docs: update
1 parent 2f95e32 commit c627681

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: build
22

33
on:
44
push:

README.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
1-
# @antv/expr ![gzip size](https://img.badgesize.io/https://unpkg.com/@antv/expr/dist/index.esm.js?compression=gzip)
1+
<div align="center">
22

3-
Have you ever wanted to make your SSR charts more dynamic but worried about security risks?
3+
<h1>@antv/expr: Mathematical Expression Parser</h1>
4+
5+
Lightweight JavaScript expression parser and evaluator, safety and high-performance. 🚀
6+
7+
![gzip size](https://img.badgesize.io/https://unpkg.com/@antv/expr/dist/index.esm.js?compression=gzip)
8+
[![Build Status](https://github.com/antvis/expr/actions/workflows/build.yml/badge.svg)](https://github.com/antvis/expr/actions/workflows/build.yml)
9+
[![npm Version](https://img.shields.io/npm/v/@antv/expr.svg)](https://www.npmjs.com/package/@antv/expr)
10+
[![npm Download](https://img.shields.io/npm/dm/@antv/expr.svg)](https://www.npmjs.com/package/@antv/expr)
11+
12+
</div>
13+
14+
Used to parse a _mathematical expressions_ to _JavaScript function_ safely. For example, in [@antv/g2](https://github.com/antvis/expr), we can set the style with an expressions.
15+
16+
```ts
17+
{
18+
// Equivalent to function: `d => d.value > 100 ? 'red' : 'green'`
19+
fill: "{ d.value > 100 ? 'red' : 'green' }",
20+
}
21+
```
422

5-
We've got you covered! Our solution introduces an easy-to-use template syntax that safely serializes functions, allowing you to dynamically render charts without compromising security. 🚀
623

724
## ✨ Features
825

@@ -25,6 +42,15 @@ pnpm add @antv/expr
2542

2643
## 🔨 Usage
2744

45+
- [Synchronous Expression Evaluation](#synchronous-expression-evaluation)
46+
- [Pre-compiling Expressions](#pre-compiling-expressions)
47+
- [Registering and Calling Functions](#registering-and-calling-functions)
48+
- [Variable References](#variable-references)
49+
- [Arithmetic Operations](#arithmetic-operations)
50+
- [Comparison and Logical Operations](#comparison-and-logical-operations)
51+
- [Conditional (Ternary) Expressions](#conditional-ternary-expressions)
52+
- [Timeout Handling](#timeout-handling)
53+
2854
### Synchronous Expression Evaluation
2955

3056
```typescript

0 commit comments

Comments
 (0)