dental-plaque-chart
Version:
A basic implementation of a dental plaque chart, using React and Tailwind.
79 lines (54 loc) • 1.52 kB
Markdown
This is a component library for rendering 4-sides dental plaque charts.

You can use this library to create a dental chart for your dental software.
Use the model to save the chart state to the database.
Use the hook to access information about the model. Build a custom UI around the chart using this information.

```shell
npm install dental-plaque-chart
```
```js
import {useDentalPlaqueChart, DentalPlaqueChart} from "dental-plaque-chart"
const MyChart = () => {
// Get a chart model
const chart = useDentalPlaqueChart()
// Define a size for the container
return (
<div style={{width: '800px'}}>
<DentalPlaqueChart chart={chart}/>
</div>
)
}
```
```js
<DentalPlaqueChart chart={chart} disabled/>
```
```js
const chart = useDentalPlaqueChart()
const model = chart.getModel()
// Save model to database
// ...
```
```js
const model = // Load model from database...
const chart = useDentalPlaqueChart({model})
```
```js
const count = chart.getPresentDentalPieces() // 0 to 32
```
```js
const count = chart.getMarkedSurfaces() // 0 to 128
```
```js
const count = chart.getPlaqueRatio() // 0.0 to 1.0
const percentage = count * 100 // 0% to 100%
```