semvec/pypi-packages huggingface dataset:
streamlit-cytoscapejs 0.0.2
A Streamlit custom component for Cytoscape.js
Requires Python: >=3.6

# Streamlit Cytoscape.js

Streamlit wrapper of [React Cytoscape.js](https://github.com/plotly/react-cytoscapejs).

## Installation

```
pip install streamlit-cytoscapejs
```

## Try it

```python
import streamlit as st
from streamlit_cytoscapejs import st_cytoscapejs

elements = [
    {"data": {"id": "one", "label": "Node 1"}, "position": {"x": 0, "y": 0}},
    {"data": {"id": "two", "label": "Node 2"}, "position": {"x": 100, "y": 0}},
    {"data": {"source": "one", "target": "two", "label": "Edge from Node1 to Node2"}},
]
stylesheet = [
    {"selector": "node", "style": {"width": 20, "height": 20, "shape": "rectangle"}},
    {"selector": "edge", "style": {"width": 10}},
]

st.title("Hello Cytoscape.js")
clicked_elements = st_cytoscapejs(elements, stylesheet)

if clicked_elements is not None:
    st.write(clicked_elements)
```

## Development

### Install

- JS side

```shell script
cd streamlit_cytoscape/frontend
npm install
```

- Python side

```shell script
conda create -n streamlit-cytoscapejs python=3.7
conda activate streamlit-cytoscapejs
pip install -e .
```

### Run

Both webpack dev server and Streamlit should run at the same time.

- JS side

```shell script
cd streamlit_cytoscape/frontend
npm run start
```

- Python side

```shell script
streamlit run app.py
```

## Next steps

I don't plan to make a lot of progress on this for now (except if huge interest) but if you want to contribute/take over its development I'm happy to lend a hand :).

Obviously missing lots of things like:

- viewport manipulation props from React cytoscapejs.
- custom layout
- adding an extension (but also you'd better fork this repo and add the extension yourself I think :/)

## References

- [React Cytoscape.js](https://github.com/plotly/react-cytoscapejs)
- [Cytoscape.js source code demos](https://github.com/cytoscape/cytoscape.js/tree/master/documentation/demos)
vdldraw 0.1.7
Batch plot the log files exported from VisualDL using Matplotlib.

# VDLdraw

Batch plot the log files exported from VisualDL using Matplotlib.

|                           VisualDL                           |                           VDLdraw                            |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| ![vdlmiou](https://user-images.githubusercontent.com/71769312/150273335-ef849dd6-a47f-4972-90b5-d917c24419dd.png) | ![Evaluate@mIoU](https://user-images.githubusercontent.com/71769312/150273323-4fbfb5c7-1353-4c05-b386-dc61db741eda.png) |

## How to install

It can be installed through `pip`:

```shell
pip install vdldraw
```

## How to use

Online experiences in [AI Studio](https://aistudio.baidu.com/aistudio/projectdetail/3414078) (Chinese).

```python
from vdldraw import get_tags, vdl_draw_folder


## 1.View available tags
get_tags(log_folder)
# Output like this:
# ['Evaluate/F1', 'Train/loss', 'Evaluate/mIoU', 'Evaluate/Acc']

## 2.Make up tags to be displayed
tag_list = ['Evaluate/mIoU', 'Evaluate/Acc']

## 3.Save image
vdl_draw_folder(log_folder, tag_list, save_folder="output", mplstyle=None)
# Args:
# 	 log_folder (str): Folder path where logs are saved.
# 	 tag_list (list): List of tags to be displayed.
# 	 save_folder (str, option): Folder path to save pictures. Default: "output".
# 	 mplstyle (str/path): Matplotlib style system. Default: None(Styles defined using VDLdraw).
```

## Colormap

Colormap reference [antv's contrasting orange](https://antv.vision/zh/docs/specification/language/palette#%E5%BC%BA%E5%AF%B9%E6%AF%94%E4%B8%BB%E9%A2%98), 20 colors in total.

![colors](https://user-images.githubusercontent.com/71769312/150271480-bea94bf9-140d-4f0d-839f-4b8022397e62.png)

## Style

If you need use some styles, you could use [SciencePlots](https://github.com/garrettj403/SciencePlots). This repo has Matplotlib styles to format your figures for scientific papers, presentations and theses.