@upsetjs/react v1.11.0
UpSet.js
UpSet.js is a JavaScript reimplementation of UpSetR which itself is based on UpSet. The library is written in React. The UpSet
React component is implemented as a pure functional component soley depending on the given properties.
A detailed description can be found at the README on the main Github Monorepo.
Usage
npm install @upsetjs/react react react-dom
import React from 'react';
import UpSet, { extractSets, generateIntersections, ISetLike } from '@upsetjs/react';
const elems = [
{ name: 'A', sets: ['S1', 'S2'] },
{ name: 'B', sets: ['S1'] },
{ name: 'C', sets: ['S2'] },
{ name: 'D', sets: ['S1', 'S3'] },
];
const sets = extractSets(elems);
const combinations = generateIntersections(sets);
<UpSet sets={sets} combinations={combinations} width={500} height={300} />;
with stored selection
const UpSetSelection = (props: any) => {
[selection, setSelection] = React.useState(null as ISetLike<any> | null);
return <UpSet {...props} selection={selection} onHover={setSelection} />;
};
<UpSetSelection sets={sets} combinations={combinations} />;
License
Commercial license
If you want to use Upset.js for a commercial application the commercial license is the appropriate license. With this option, your source code is kept proprietary. Contact @sgratzl for details
Open-source license
GNU AGPLv3
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago