marsilea 0.3.5__tar.gz → 0.3.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {marsilea-0.3.5 → marsilea-0.3.6}/PKG-INFO +2 -2
- marsilea-0.3.6/app/.streamlit/pages.toml +24 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/Home.py +41 -25
- {marsilea-0.3.5 → marsilea-0.3.6}/app/components/cmap_selector/selector.py +66 -49
- {marsilea-0.3.5 → marsilea-0.3.6}/app/components/data_input.py +39 -34
- {marsilea-0.3.5 → marsilea-0.3.6}/app/components/example_download.py +4 -4
- {marsilea-0.3.5 → marsilea-0.3.6}/app/components/initialize.py +11 -9
- {marsilea-0.3.5 → marsilea-0.3.6}/app/components/main_plots.py +55 -59
- {marsilea-0.3.5 → marsilea-0.3.6}/app/components/resource.py +50 -22
- {marsilea-0.3.5 → marsilea-0.3.6}/app/components/saver.py +11 -10
- {marsilea-0.3.5 → marsilea-0.3.6}/app/components/side_plots.py +318 -202
- {marsilea-0.3.5 → marsilea-0.3.6}/app/components/state.py +29 -24
- {marsilea-0.3.5 → marsilea-0.3.6}/app/components/transformation.py +20 -14
- marsilea-0.3.6/app/pages/01 Simple_Heatmap.py +243 -0
- marsilea-0.3.5/app/pages/02 X-Layout_Heatmap.py → marsilea-0.3.6/app/pages/02 Cross-Layout_Heatmap.py +42 -39
- {marsilea-0.3.5 → marsilea-0.3.6}/app/pages/03 Upsetplot.py +76 -67
- marsilea-0.3.6/app/pages/04 Manual.py +60 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/requirements.txt +2 -2
- {marsilea-0.3.5 → marsilea-0.3.6}/app/script/plot_layer_example_images.py +1 -2
- {marsilea-0.3.5 → marsilea-0.3.6}/app/script/plotter_example_images.py +35 -23
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Basics/plot_adv_heatmap.py +3 -1
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Basics/plot_stacked_bar.py +11 -9
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Basics/plot_two_heatmap.py +2 -2
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Gallery/plot_arc_diagram.py +26 -16
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Gallery/plot_available_plotters.py +34 -19
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Gallery/plot_bivariate_dist.py +11 -11
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Gallery/plot_mouse_embryo.py +35 -35
- marsilea-0.3.6/docs/examples/Gallery/plot_oil_well.py +122 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Gallery/plot_oncoprint.py +39 -23
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Gallery/plot_pbmc3k.py +46 -25
- marsilea-0.3.6/docs/examples/Gallery/plot_sc_multiomics.py +140 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Gallery/plot_seqalign.py +35 -30
- marsilea-0.3.6/docs/examples/Gallery/plot_upset.py +72 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_chunk.py +4 -3
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_fixed_chunk.py +12 -5
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_labels.py +2 -2
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_marker_mesh.py +1 -1
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_seq_logo.py +1 -2
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_title.py +1 -1
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/how_to/customization/plot_add_border.py +0 -1
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/how_to/customization/plot_get_axes.py +12 -3
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/how_to/dendrogram/plot_color_dendrogram.py +0 -1
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/how_to/layout/plot_adjust_figure_size.py +2 -2
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/how_to/layout/plot_labeling.py +10 -4
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/how_to/legends/plot_legends.py +0 -1
- marsilea-0.3.6/docs/how_to/save/plot.pdf +0 -0
- marsilea-0.3.6/docs/how_to/save/plot.png +0 -0
- marsilea-0.3.6/docs/source/conf.py +163 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/source/sg_execution_times.rst +94 -88
- {marsilea-0.3.5 → marsilea-0.3.6}/scripts/benchmark/result.py +13 -4
- marsilea-0.3.6/scripts/example_figures/arc-diagrams.py +164 -0
- marsilea-0.3.6/scripts/example_figures/cooking_oils.py +122 -0
- marsilea-0.3.6/scripts/example_figures/mouse_map.py +157 -0
- marsilea-0.3.6/scripts/example_figures/msa.py +148 -0
- marsilea-0.3.6/scripts/example_figures/oncoprint.py +143 -0
- marsilea-0.3.6/scripts/example_figures/single-heatmap.py +101 -0
- marsilea-0.3.6/scripts/example_figures/tracks.py +141 -0
- marsilea-0.3.6/scripts/example_figures/two-heatmap.py +141 -0
- marsilea-0.3.6/scripts/example_figures/upset.py +56 -0
- marsilea-0.3.6/scripts/example_figures/violin_swarm.py +71 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/__init__.py +10 -5
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/base.py +78 -51
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/plotter/__init__.py +1 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/plotter/_images.py +7 -5
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/plotter/_seaborn.py +4 -2
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/plotter/arc.py +4 -2
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/plotter/area.py +18 -9
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/plotter/bar.py +3 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/plotter/base.py +25 -6
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/plotter/mesh.py +24 -2
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/upset.py +12 -2
- {marsilea-0.3.5 → marsilea-0.3.6}/src/oncoprinter/core.py +79 -15
- marsilea-0.3.5/app/pages/01 Simple_Heatmap.py +0 -218
- marsilea-0.3.5/app/pages/04 Manual.py +0 -52
- marsilea-0.3.5/docs/examples/Gallery/plot_oil_well.py +0 -92
- marsilea-0.3.5/docs/examples/Gallery/plot_sc_multiomics.py +0 -86
- marsilea-0.3.5/docs/examples/Gallery/plot_upset.py +0 -53
- marsilea-0.3.5/docs/how_to/save/plot.pdf +0 -0
- marsilea-0.3.5/docs/how_to/save/plot.png +0 -0
- marsilea-0.3.5/docs/source/conf.py +0 -149
- marsilea-0.3.5/scripts/logo.py +0 -78
- marsilea-0.3.5/scripts/pub_figure.py +0 -15
- marsilea-0.3.5/scripts/pub_figures/bivariate_kde.py +0 -77
- marsilea-0.3.5/scripts/pub_figures/layout-skeleton-step.py +0 -107
- marsilea-0.3.5/scripts/pub_figures/layout-step.py +0 -120
- marsilea-0.3.5/scripts/pub_figures/onco.py +0 -64
- marsilea-0.3.5/scripts/pub_figures/stacked_bar.py +0 -35
- marsilea-0.3.5/scripts/pub_figures/upset.py +0 -43
- marsilea-0.3.5/scripts/x-layout.py +0 -46
- {marsilea-0.3.5 → marsilea-0.3.6}/.github/workflows/build.yaml +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/.github/workflows/deploy_streamlit.yaml +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/.github/workflows/lint.yaml +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/.gitignore +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/.streamlit/config.toml +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/CITATION.cff +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/CODE_OF_CONDUCT.md +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/LICENSE +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/README.md +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/.gitignore +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/Dockerfile +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/README.md +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/components/__init__.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/components/cmap_selector/__init__.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/components/upset_example.csv +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/V1.mp4 +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/V2.mp4 +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/annolabels.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/bar.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/box.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/boxen.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/colors.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/dendrogram.svg +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/favicon.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/favicon.svg +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/heatmap.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/heatmap.svg +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/logo.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/mark_map.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/mark_map.svg +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/point.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/sized_heatmap.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/sized_heatmap.svg +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/sized_onlymap.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/strip.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/swarm.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/violin.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/img/x-layout.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/script/heatmap_data.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/set_data_memberships.txt +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/test.xlsx +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/test_data/Stats_plot.txt +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/test_data/example_data.txt +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/test_data/number.txt +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/test_data/row_labels.txt +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/test_data/set_data_memberships.txt +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/app/upset.xlsx +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/data/IMDB.csv +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/data/PATIENT_DATA_oncoprint.tsv +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/data/pbmc3k.h5ad +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/Makefile +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/README.md +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/.gitignore +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Basics/README.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Basics/plot_heatmap.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Gallery/README.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/README.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_anno_labels.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_arc.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_area.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_bar.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_box.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_boxen.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_center_bar.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_color_mesh.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_colors.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_numbers.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_point.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_sized_mesh.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_stack_bar.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_strip.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_swarm.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_text_mesh.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/Plotters/plot_violin.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/examples/README.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/how_to/README.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/how_to/customization/README.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/how_to/dendrogram/README.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/how_to/dendrogram/plot_dendrogram_control.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/how_to/layout/README.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/how_to/layout/plot_margin.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/how_to/legends/README.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/how_to/legends/plot_disable_legend.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/how_to/save/README.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/how_to/save/plot_save.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/make.bat +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/requirements.txt +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/source/.gitignore +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/source/_static/css/custom.css +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/source/_templates/autosummary.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/source/api/index.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/source/img/code_example.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/source/img/cover.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/source/img/marsilea-renderplan-logic.drawio.svg +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/source/index.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/source/installation.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/source/tutorial/axes-level.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/source/tutorial/concatenation.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/source/tutorial/heatmap.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/source/tutorial/index.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/source/tutorial/intro.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/source/tutorial/intro2.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/source/tutorial/new_renderplan.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/docs/source/tutorial/upset.rst +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/Logo(1).zip +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/Logo.zip +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/banner-blue.jpg +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/banner-dark-gradient.jpg +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/banner-dark.jpg +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/banner-rice-white.jpg +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/banner-white.jpg +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/logo/Logo/.DS_Store +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/logo/Logo/Logo.svg +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/logo/Logo/logo.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/logo/Logo//346/265/205/350/223/235/346/270/220/345/217/230.jpg" +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/logo/Logo//346/267/261/350/211/262/350/203/214/346/231/257.jpg" +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/logo/Logo//347/261/263/350/211/262.jpg" +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/logo/Logo//347/272/257/347/231/275.jpg" +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/logo/Logo//350/247/222/345/272/246/346/270/220/345/217/230.jpg" +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/logo/__MACOSX/Logo/._.DS_Store +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/logo.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/logo.svg +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/API-interface.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/Snap-1.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/Snap-2.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/Snap-3.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/Stacked bar.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/bivar_kde.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-basic-change-canvas-size-code.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-basic-change-canvas-size.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-basic-change-location-code.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-basic-change-location.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-basic-change-pad-code.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-basic-change-pad.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-basic-change-plotter-size-code.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-basic-change-plotter-size.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-basic-change-plotter-type-code.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-basic-change-plotter-type.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-basic-code.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-basic.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-skeleton-step1.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-skeleton-step2.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-skeleton-step3.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-skeleton-step4.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-step-1a-code.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-step-1a.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-step-1b-code.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-step-1b.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-step-2-code.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-step-2.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-step-3-code.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-step-3.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-step-4-code.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/layout-step-4.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/oncoprint.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/upset.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/web-app-screenshot-1.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/img/publication/web-app-screenshot-2.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/pyproject.toml +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/readthedocs.yaml +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/scripts/benchmark/marsilea/marsilea_cooking_oils_base.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/scripts/benchmark/marsilea/marsilea_cooking_oils_v1.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/scripts/benchmark/marsilea/marsilea_cooking_oils_v2.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/scripts/benchmark/marsilea_vs_matplotlib.png +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/scripts/benchmark/marsilea_vs_matplotlib.svg +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/scripts/benchmark/matplotlib/matplotlib_cooking_oils_base.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/scripts/benchmark/matplotlib/matplotlib_cooking_oils_v1.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/scripts/benchmark/matplotlib/matplotlib_cooking_oils_v2.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/scripts/publication/arc_diagram.svg +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/scripts/publication/bivariate_dist.svg +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/scripts/publication/mouse_embryo.svg +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/setup.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/_api.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/_deform.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/dataset.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/dendrogram.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/exceptions.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/heatmap.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/layers.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/layout.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/plotter/_utils.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/plotter/bio.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/plotter/text.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/src/marsilea/utils.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/src/oncoprinter/__init__.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/src/oncoprinter/preset.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/tests/test_data_input.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/tests/test_deform.py +0 -0
- {marsilea-0.3.5 → marsilea-0.3.6}/tests/test_mesh.py +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[[pages]]
|
|
2
|
+
path = "index.py"
|
|
3
|
+
name = "Home"
|
|
4
|
+
icon = "🏠"
|
|
5
|
+
|
|
6
|
+
#[[pages]]
|
|
7
|
+
#path = "other_pages/page2.py"
|
|
8
|
+
#name = "Page 2"
|
|
9
|
+
#icon = ":books:"
|
|
10
|
+
#
|
|
11
|
+
#[[pages]]
|
|
12
|
+
#name = "My second"
|
|
13
|
+
#icon = "🎈️"
|
|
14
|
+
#is_section = true
|
|
15
|
+
#
|
|
16
|
+
## Pages after an `is_section = true` will be indented
|
|
17
|
+
#[[pages]]
|
|
18
|
+
#name = "Another page"
|
|
19
|
+
#icon = "💪"
|
|
20
|
+
#
|
|
21
|
+
## Unless you explicitly say in_section = false`
|
|
22
|
+
#[[pages]]
|
|
23
|
+
#name = "Not in a section"
|
|
24
|
+
#in_section = false
|
|
@@ -1,35 +1,37 @@
|
|
|
1
1
|
import streamlit as st
|
|
2
|
-
|
|
3
2
|
from components.initialize import init_page, inject_css
|
|
4
3
|
|
|
5
4
|
init_page("Marsilea")
|
|
6
5
|
inject_css()
|
|
7
6
|
|
|
8
|
-
banner, title = st.columns([1, 1.
|
|
7
|
+
banner, title = st.columns([1, 1.5])
|
|
9
8
|
with banner:
|
|
10
9
|
st.markdown(
|
|
11
10
|
'<video controls width="250" autoplay="true" muted="true" '
|
|
12
11
|
'loop="true" playsinline style="pointer-events: none;">'
|
|
13
12
|
'<source src="https://raw.githubusercontent.com/Marsilea-viz/'
|
|
14
13
|
'marsilea/main/app/img/V1.mp4" '
|
|
15
|
-
'type="video/mp4" /></video>',
|
|
14
|
+
'type="video/mp4" /></video>',
|
|
15
|
+
unsafe_allow_html=True,
|
|
16
|
+
)
|
|
16
17
|
|
|
17
18
|
with title:
|
|
18
19
|
st.title("Marsilea")
|
|
19
|
-
st.subheader("Create :blue[
|
|
20
|
+
st.subheader("Create :blue[composable] visualization")
|
|
20
21
|
st.text("")
|
|
21
22
|
st.markdown(
|
|
22
23
|
"*By [Mr.Milk](https://github.com/Mr-Milk) and "
|
|
23
|
-
"[Squirtle692](https://github.com/Squirtle692)*"
|
|
24
|
+
"[Squirtle692](https://github.com/Squirtle692)*"
|
|
25
|
+
)
|
|
24
26
|
|
|
25
27
|
st.markdown("---")
|
|
26
28
|
|
|
27
29
|
st.subheader("About")
|
|
28
|
-
st.markdown(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
st.markdown(
|
|
31
|
+
"Marsilea is a tool for you to create composable visualization. "
|
|
32
|
+
"A single-plot visualization can be combined with other plots to capture"
|
|
33
|
+
"the full picture of your data."
|
|
34
|
+
)
|
|
33
35
|
|
|
34
36
|
st.markdown("---")
|
|
35
37
|
|
|
@@ -45,24 +47,36 @@ def tools(name, img, page, size=150):
|
|
|
45
47
|
f'<p style="font-weight: 600;">{name}</p>'
|
|
46
48
|
f'<a target="_self" href="{page}">'
|
|
47
49
|
f'<img style="width: {size}px;" src="{img}"></a>'
|
|
48
|
-
f
|
|
49
|
-
unsafe_allow_html=True
|
|
50
|
+
f"</div>",
|
|
51
|
+
unsafe_allow_html=True,
|
|
52
|
+
)
|
|
50
53
|
|
|
51
54
|
|
|
52
55
|
with t1:
|
|
53
|
-
tools(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
tools(
|
|
57
|
+
"Simple Heatmap",
|
|
58
|
+
"https://marsilea.readthedocs.io/en/latest/" "_images/concatenation-1.png",
|
|
59
|
+
page="/Simple_Heatmap",
|
|
60
|
+
size=130,
|
|
61
|
+
)
|
|
56
62
|
|
|
57
63
|
with t2:
|
|
58
|
-
tools(
|
|
59
|
-
|
|
60
|
-
|
|
64
|
+
tools(
|
|
65
|
+
"Complex Heatmap",
|
|
66
|
+
"https://marsilea.readthedocs.io/en/latest/"
|
|
67
|
+
"_images/sphx_glr_plot_pbmc3k_thumb.png",
|
|
68
|
+
page="X-Layout_Heatmap",
|
|
69
|
+
size=200,
|
|
70
|
+
)
|
|
61
71
|
|
|
62
72
|
with t3:
|
|
63
|
-
tools(
|
|
64
|
-
|
|
65
|
-
|
|
73
|
+
tools(
|
|
74
|
+
"Upset Plot",
|
|
75
|
+
"https://marsilea.readthedocs.io/en/latest/"
|
|
76
|
+
"_images/sphx_glr_plot_upset_thumb.png",
|
|
77
|
+
page="/Upsetplot",
|
|
78
|
+
size=220,
|
|
79
|
+
)
|
|
66
80
|
|
|
67
81
|
st.markdown("---")
|
|
68
82
|
|
|
@@ -72,13 +86,15 @@ s1, s2, s3 = st.columns([1, 4, 5])
|
|
|
72
86
|
with s1:
|
|
73
87
|
st.image(
|
|
74
88
|
"https://cdn3.iconfinder.com/data/icons/logos-and-brands-adobe/512/267_Python-512.png",
|
|
75
|
-
width=50
|
|
89
|
+
width=50,
|
|
90
|
+
)
|
|
76
91
|
|
|
77
92
|
with s2:
|
|
78
|
-
st.markdown(
|
|
79
|
-
|
|
93
|
+
st.markdown(
|
|
94
|
+
"Familiar with Python? Try our Python package "
|
|
95
|
+
"that can be easily integrated into your data pipeline!"
|
|
96
|
+
)
|
|
80
97
|
with s3:
|
|
81
|
-
|
|
82
98
|
st.code("pip install marsilea", language="bash")
|
|
83
99
|
|
|
84
100
|
st.markdown("---")
|
|
@@ -3,8 +3,12 @@ import matplotlib.pyplot as plt
|
|
|
3
3
|
import numpy as np
|
|
4
4
|
import streamlit as st
|
|
5
5
|
from matplotlib.cm import get_cmap
|
|
6
|
-
from matplotlib.colors import
|
|
7
|
-
|
|
6
|
+
from matplotlib.colors import (
|
|
7
|
+
LinearSegmentedColormap,
|
|
8
|
+
Normalize,
|
|
9
|
+
CenteredNorm,
|
|
10
|
+
TwoSlopeNorm,
|
|
11
|
+
)
|
|
8
12
|
|
|
9
13
|
|
|
10
14
|
@st.cache_data
|
|
@@ -21,7 +25,7 @@ def get_colormap_images(cmap):
|
|
|
21
25
|
gradient = np.linspace(0, 1, 256)
|
|
22
26
|
gradient = np.vstack((gradient, gradient))
|
|
23
27
|
|
|
24
|
-
fig = plt.figure(figsize=(6, .5), dpi=90)
|
|
28
|
+
fig = plt.figure(figsize=(6, 0.5), dpi=90)
|
|
25
29
|
ax = fig.add_axes([0, 0, 1, 1])
|
|
26
30
|
ax.imshow(gradient, aspect="auto", cmap=cmap)
|
|
27
31
|
ax.set_axis_off()
|
|
@@ -30,11 +34,10 @@ def get_colormap_images(cmap):
|
|
|
30
34
|
|
|
31
35
|
|
|
32
36
|
def random_color():
|
|
33
|
-
return "#" + "".join(np.random.choice(list(
|
|
37
|
+
return "#" + "".join(np.random.choice(list("0123456789ABCDEF"), 6))
|
|
34
38
|
|
|
35
39
|
|
|
36
40
|
class ColormapSelector:
|
|
37
|
-
|
|
38
41
|
def __init__(self, key, default="coolwarm", data_mapping=True):
|
|
39
42
|
cmap_data = get_colormap_names()
|
|
40
43
|
cmap_options = sorted(cmap_data.keys())
|
|
@@ -46,28 +49,29 @@ class ColormapSelector:
|
|
|
46
49
|
radio_box, rev_box = st.columns(2)
|
|
47
50
|
|
|
48
51
|
with radio_box:
|
|
49
|
-
input_cmap = st.radio(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
input_cmap = st.radio(
|
|
53
|
+
label="cmap_input",
|
|
54
|
+
label_visibility="collapsed",
|
|
55
|
+
options=["Preset", "Create New"],
|
|
56
|
+
horizontal=True,
|
|
57
|
+
key=f"{key}-input-cmap",
|
|
58
|
+
)
|
|
55
59
|
with rev_box:
|
|
56
|
-
self.reverse = st.checkbox("Reverse colormap",
|
|
57
|
-
key=f'{key}-rev-cmap')
|
|
60
|
+
self.reverse = st.checkbox("Reverse colormap", key=f"{key}-rev-cmap")
|
|
58
61
|
|
|
59
62
|
if input_cmap == "Preset":
|
|
60
63
|
color_box, cmap_box = st.columns(2)
|
|
61
64
|
with color_box:
|
|
62
|
-
cmap = st.selectbox(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
cmap = st.selectbox(
|
|
66
|
+
"Select Preset Colormap",
|
|
67
|
+
label_visibility="collapsed",
|
|
68
|
+
key=f"{key}-preset-cmap",
|
|
69
|
+
options=cmap_options,
|
|
70
|
+
index=default_index,
|
|
71
|
+
format_func=lambda v: cmap_data[v],
|
|
72
|
+
help="The preset colormap are illuminated "
|
|
73
|
+
"compensated for best visual effect",
|
|
74
|
+
)
|
|
71
75
|
cmap = get_cmap(cmap)
|
|
72
76
|
if self.reverse:
|
|
73
77
|
cmap = cmap.reversed()
|
|
@@ -79,29 +83,36 @@ class ColormapSelector:
|
|
|
79
83
|
select_box, cmap_box = st.columns(2)
|
|
80
84
|
with select_box:
|
|
81
85
|
ncolors = st.selectbox(
|
|
82
|
-
label="Colormap Type",
|
|
86
|
+
label="Colormap Type",
|
|
87
|
+
key=f"{key}-select-gradient",
|
|
83
88
|
label_visibility="collapsed",
|
|
84
|
-
options=["One Gradient", "Two Gradient"]
|
|
89
|
+
options=["One Gradient", "Two Gradient"],
|
|
90
|
+
)
|
|
85
91
|
_, c_lower, c_center, c_upper = st.columns([4, 1, 1, 1])
|
|
86
92
|
with c_lower:
|
|
87
|
-
lower = st.color_picker(
|
|
88
|
-
|
|
89
|
-
|
|
93
|
+
lower = st.color_picker(
|
|
94
|
+
label="Lower",
|
|
95
|
+
value="#CB1B45",
|
|
96
|
+
key=f"{key}-lower-cmap-2",
|
|
97
|
+
)
|
|
90
98
|
with c_upper:
|
|
91
|
-
upper = st.color_picker(
|
|
92
|
-
|
|
93
|
-
|
|
99
|
+
upper = st.color_picker(
|
|
100
|
+
label="Upper",
|
|
101
|
+
value="#7B90D2",
|
|
102
|
+
key=f"{key}-upper-cmap-2",
|
|
103
|
+
)
|
|
94
104
|
|
|
95
105
|
if ncolors == "One Gradient":
|
|
96
106
|
colors = [lower, upper]
|
|
97
107
|
else:
|
|
98
108
|
with c_center:
|
|
99
|
-
center = st.color_picker(
|
|
100
|
-
|
|
101
|
-
|
|
109
|
+
center = st.color_picker(
|
|
110
|
+
label="Center",
|
|
111
|
+
value="#BDC0BA",
|
|
112
|
+
key=f"{key}-center-cmap-3",
|
|
113
|
+
)
|
|
102
114
|
colors = [lower, center, upper]
|
|
103
|
-
self.cmap = (
|
|
104
|
-
.from_list("user_cmap", colors))
|
|
115
|
+
self.cmap = LinearSegmentedColormap.from_list("user_cmap", colors)
|
|
105
116
|
|
|
106
117
|
if self.reverse:
|
|
107
118
|
self.cmap = self.cmap.reversed()
|
|
@@ -113,44 +124,50 @@ class ColormapSelector:
|
|
|
113
124
|
if data_mapping:
|
|
114
125
|
norm_strategy = st.selectbox(
|
|
115
126
|
"Mapping Strategy",
|
|
116
|
-
key=f
|
|
117
|
-
options=["Linear", "Min-Max", "Centered On", "Two Range"]
|
|
127
|
+
key=f"{key}-norm-selector",
|
|
128
|
+
options=["Linear", "Min-Max", "Centered On", "Two Range"],
|
|
129
|
+
)
|
|
118
130
|
self.norm = None
|
|
119
131
|
if norm_strategy == "Min-Max":
|
|
120
132
|
st.caption("Value outside the min/max will be mapped to min/max")
|
|
121
133
|
v1, v2 = st.columns(2)
|
|
122
134
|
with v1:
|
|
123
|
-
vmin = st.number_input("Min", key=f
|
|
135
|
+
vmin = st.number_input("Min", key=f"{key}-norm-vmin")
|
|
124
136
|
with v2:
|
|
125
|
-
vmax = st.number_input("Max", key=f
|
|
137
|
+
vmax = st.number_input("Max", key=f"{key}-norm-vmax")
|
|
126
138
|
self.norm = Normalize(vmin=vmin, vmax=vmax)
|
|
127
139
|
elif norm_strategy == "Centered On":
|
|
128
140
|
st.caption("Center on a specific value and extend symmetrically")
|
|
129
141
|
v1, v2 = st.columns(2)
|
|
130
142
|
with v1:
|
|
131
|
-
vcenter = st.number_input(
|
|
132
|
-
|
|
143
|
+
vcenter = st.number_input(
|
|
144
|
+
"Center", key=f"{key}-center_norm-vcenter"
|
|
145
|
+
)
|
|
133
146
|
with v2:
|
|
134
|
-
vhalf = st.number_input(
|
|
135
|
-
|
|
147
|
+
vhalf = st.number_input(
|
|
148
|
+
"Extend",
|
|
149
|
+
min_value=0.0,
|
|
150
|
+
value=1.0,
|
|
151
|
+
key=f"{key}-center_norm-vhalf",
|
|
152
|
+
)
|
|
136
153
|
self.norm = CenteredNorm(vcenter=vcenter, halfrange=vhalf)
|
|
137
154
|
elif norm_strategy == "Two Range":
|
|
138
155
|
st.caption("Map to two range")
|
|
139
156
|
v1, v2, v3 = st.columns(3)
|
|
140
157
|
with v1:
|
|
141
|
-
vmin = st.number_input(
|
|
142
|
-
"Min", value=0., key=f'{key}-tsnorm-vmin')
|
|
158
|
+
vmin = st.number_input("Min", value=0.0, key=f"{key}-tsnorm-vmin")
|
|
143
159
|
with v2:
|
|
144
160
|
vcenter = st.number_input(
|
|
145
|
-
"Center", value=vmin+1, key=f
|
|
161
|
+
"Center", value=vmin + 1, key=f"{key}-tsnorm-vcenter"
|
|
162
|
+
)
|
|
146
163
|
with v3:
|
|
147
164
|
vmax = st.number_input(
|
|
148
|
-
"Max", value=vcenter+1, key=f
|
|
165
|
+
"Max", value=vcenter + 1, key=f"{key}-tsnorm-vmax"
|
|
166
|
+
)
|
|
149
167
|
if not ((vmin < vcenter) and (vcenter < vmax)):
|
|
150
168
|
st.error("Min, Center, Max must be ascending.", icon="📉")
|
|
151
169
|
else:
|
|
152
|
-
self.norm = TwoSlopeNorm(vcenter=vcenter,
|
|
153
|
-
vmin=vmin, vmax=vmax)
|
|
170
|
+
self.norm = TwoSlopeNorm(vcenter=vcenter, vmin=vmin, vmax=vmax)
|
|
154
171
|
|
|
155
172
|
def get_cmap(self):
|
|
156
173
|
return self.cmap
|
|
@@ -19,20 +19,13 @@ class InputBase:
|
|
|
19
19
|
pass
|
|
20
20
|
|
|
21
21
|
def seperator(self):
|
|
22
|
-
sep_options = {
|
|
23
|
-
|
|
24
|
-
"Comma (,)": ",",
|
|
25
|
-
"Space (' ')": " "
|
|
26
|
-
}
|
|
27
|
-
user_sep = st.selectbox("Seperator", key=self.key,
|
|
28
|
-
options=sep_options.keys())
|
|
22
|
+
sep_options = {"Tab (\\t)": "\t", "Comma (,)": ",", "Space (' ')": " "}
|
|
23
|
+
user_sep = st.selectbox("Seperator", key=self.key, options=sep_options.keys())
|
|
29
24
|
self.sep = sep_options[user_sep]
|
|
30
25
|
|
|
31
26
|
|
|
32
27
|
@st.cache_data
|
|
33
|
-
def parse_file(file, header=False, index=False,
|
|
34
|
-
sheet_name=0):
|
|
35
|
-
|
|
28
|
+
def parse_file(file, header=False, index=False, sheet_name=0):
|
|
36
29
|
index_col = None if not index else 0
|
|
37
30
|
suffix = file.name.split(".")[-1]
|
|
38
31
|
if suffix in ["csv", "txt", "tsv"]:
|
|
@@ -49,17 +42,19 @@ def parse_file(file, header=False, index=False,
|
|
|
49
42
|
|
|
50
43
|
|
|
51
44
|
class FileUpload(InputBase):
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
def __init__(
|
|
46
|
+
self, key=None, header=False, index=False, use_header=False, use_index=False
|
|
47
|
+
):
|
|
55
48
|
super().__init__(key=key)
|
|
56
49
|
self.header = use_header
|
|
57
50
|
self.index = use_index
|
|
58
|
-
self.user_input = st.file_uploader(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
51
|
+
self.user_input = st.file_uploader(
|
|
52
|
+
"Choose a table file",
|
|
53
|
+
key=f"table_reader-{self.key}",
|
|
54
|
+
accept_multiple_files=False,
|
|
55
|
+
label_visibility="collapsed",
|
|
56
|
+
type=["txt", "csv", "xlsx"],
|
|
57
|
+
)
|
|
63
58
|
|
|
64
59
|
if index & header:
|
|
65
60
|
h1, h2 = st.columns(2)
|
|
@@ -78,28 +73,35 @@ class FileUpload(InputBase):
|
|
|
78
73
|
if self.user_input is not None:
|
|
79
74
|
suffix = self.user_input.name.split(".")[-1]
|
|
80
75
|
if suffix == "xlsx":
|
|
81
|
-
wb = load_workbook(
|
|
82
|
-
self.user_input, read_only=True, keep_links=False)
|
|
76
|
+
wb = load_workbook(self.user_input, read_only=True, keep_links=False)
|
|
83
77
|
sheetnames = wb.sheetnames
|
|
84
78
|
if len(sheetnames) > 1:
|
|
85
|
-
self.sheet_name =
|
|
86
|
-
|
|
87
|
-
|
|
79
|
+
self.sheet_name = st.selectbox(
|
|
80
|
+
"Please select a sheet", options=sheetnames
|
|
81
|
+
)
|
|
88
82
|
|
|
89
83
|
def _header_checkbox(self):
|
|
90
|
-
return st.checkbox(
|
|
91
|
-
|
|
92
|
-
|
|
84
|
+
return st.checkbox(
|
|
85
|
+
"Use first row as header?",
|
|
86
|
+
value=self.header,
|
|
87
|
+
key=f"select-header-{self.key}",
|
|
88
|
+
)
|
|
93
89
|
|
|
94
90
|
def _index_checkbox(self):
|
|
95
|
-
return st.checkbox(
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
return st.checkbox(
|
|
92
|
+
"Use first column as row labels?",
|
|
93
|
+
value=self.index,
|
|
94
|
+
key=f"select-index-{self.key}",
|
|
95
|
+
)
|
|
98
96
|
|
|
99
97
|
def _parse_to_df(self):
|
|
100
98
|
if self.user_input is not None:
|
|
101
|
-
return parse_file(
|
|
102
|
-
|
|
99
|
+
return parse_file(
|
|
100
|
+
self.user_input,
|
|
101
|
+
header=self.header,
|
|
102
|
+
index=self.index,
|
|
103
|
+
sheet_name=self.sheet_name,
|
|
104
|
+
)
|
|
103
105
|
|
|
104
106
|
def parse(self) -> np.ndarray:
|
|
105
107
|
if self.user_input is not None:
|
|
@@ -110,8 +112,12 @@ class FileUpload(InputBase):
|
|
|
110
112
|
|
|
111
113
|
def parse_parts(self, row_label=True, col_label=True):
|
|
112
114
|
if self.user_input is not None:
|
|
113
|
-
data = parse_file(
|
|
114
|
-
|
|
115
|
+
data = parse_file(
|
|
116
|
+
self.user_input,
|
|
117
|
+
header=col_label,
|
|
118
|
+
index=row_label,
|
|
119
|
+
sheet_name=self.sheet_name,
|
|
120
|
+
)
|
|
115
121
|
row = data.index.to_numpy(dtype=str)
|
|
116
122
|
col = data.columns.to_numpy(dtype=str)
|
|
117
123
|
data = data.to_numpy()
|
|
@@ -129,7 +135,6 @@ class FileUpload(InputBase):
|
|
|
129
135
|
|
|
130
136
|
|
|
131
137
|
class PasteText(InputBase):
|
|
132
|
-
|
|
133
138
|
def __init__(self, cast_number=True, key=None):
|
|
134
139
|
super().__init__(key=key)
|
|
135
140
|
self.cast_number = cast_number
|
|
@@ -9,7 +9,6 @@ from random_word.random_word import RandomWords
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class ExampleDataGenerator:
|
|
12
|
-
|
|
13
12
|
def __init__(self, col, row):
|
|
14
13
|
np.random.seed(0)
|
|
15
14
|
self.col = col
|
|
@@ -59,11 +58,12 @@ def get_base64():
|
|
|
59
58
|
|
|
60
59
|
|
|
61
60
|
class ExampleDownloader:
|
|
62
|
-
|
|
63
61
|
def __init__(self):
|
|
64
62
|
self.b64 = get_base64()
|
|
65
|
-
href =
|
|
66
|
-
|
|
63
|
+
href = (
|
|
64
|
+
f'<a href="data:file/zip;base64,{self.b64}" '
|
|
65
|
+
f'download="example.zip">Example Data</a>'
|
|
66
|
+
)
|
|
67
67
|
st.markdown(href, unsafe_allow_html=True)
|
|
68
68
|
|
|
69
69
|
|
|
@@ -10,8 +10,8 @@ from streamlit.runtime import caching
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
def _nestable_block(
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
self,
|
|
14
|
+
block_proto: Block_pb2.Block = Block_pb2.Block(),
|
|
15
15
|
) -> "DeltaGenerator":
|
|
16
16
|
# Operate on the active DeltaGenerator, in case we're in a `with` block.
|
|
17
17
|
dg = self._active_dg
|
|
@@ -74,7 +74,8 @@ def enable_nested_columns():
|
|
|
74
74
|
|
|
75
75
|
def inject_css():
|
|
76
76
|
# Hack the style of elements in streamlit
|
|
77
|
-
st.markdown(
|
|
77
|
+
st.markdown(
|
|
78
|
+
"""
|
|
78
79
|
<style>
|
|
79
80
|
|
|
80
81
|
# .main .block-container {
|
|
@@ -105,12 +106,13 @@ def inject_css():
|
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
</style>
|
|
108
|
-
""",
|
|
109
|
+
""",
|
|
110
|
+
unsafe_allow_html=True,
|
|
111
|
+
)
|
|
109
112
|
|
|
110
113
|
|
|
111
114
|
def init_page(title):
|
|
112
|
-
IMG_ROOT = "https://raw.githubusercontent.com/"
|
|
113
|
-
"Marsilea-viz/marsilea/main/app/img"
|
|
115
|
+
IMG_ROOT = "https://raw.githubusercontent.com/" "Marsilea-viz/marsilea/main/app/img"
|
|
114
116
|
|
|
115
117
|
st.set_page_config(
|
|
116
118
|
page_title=title,
|
|
@@ -118,7 +120,7 @@ def init_page(title):
|
|
|
118
120
|
page_icon=f"{IMG_ROOT}/favicon.png",
|
|
119
121
|
# initial_sidebar_state="collapsed",
|
|
120
122
|
menu_items={
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
123
|
+
"Report a bug": "https://github.com/Marsilea-viz/marsilea/issues/new/choose",
|
|
124
|
+
"About": "A web interface for Marsilea",
|
|
125
|
+
},
|
|
124
126
|
)
|