Giter Site home page Giter Site logo

qualzz / sd_concept_browser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codedealer/streamlit-component-template-vue

0.0 0.0 0.0 580 KB

Vue 3 template for Streamlit Components

License: MIT License

JavaScript 0.87% Python 10.52% TypeScript 3.22% HTML 0.34% Vue 85.05%

sd_concept_browser's Introduction

Streamlit Component template in Vue.js

Vue 3 template to build a Streamlit component. Uses Vue.js scoped slot to send parameters from Streamlit Python script into args props of your component.

Differences from the upstream

Built with Vite, Vue3 and Typescript to be light and fast.

Setup

  • Ensure you have Python 3.8+, Node.js, npm and (optionally) yarn installed.
  • Generate template from this repo by using Use this template button on the repo's Github page.
  • Create a new Python virtual environment for the template using your preferred method.
  • Install Streamlit:
$ pip install streamlit
  • Initialize and run the component template frontend:
$ cd my_component/frontend
$ yarn install    # Install the dependencies
$ yarn run dev  # Start the dev server
  • From a separate terminal, run the template's Streamlit app:
$ streamlit run my_component/__init__.py
  • If all goes well, you should see something like this: Quickstart Success
  • Modify the frontend code at my_component/frontend/src/Component.vue.
    • Parameters passed by Python script are made available in args props.
  • Modify the Python code at my_component/__init__.py.
  • Feel free to rename the my_component folder, Component.vue file with its import in app.vue, and package name in setup.py and package.json.

Publish

When you're ready to publish the component:

  • Rename your my_component folder to the name of your component if you haven't done so yet
  • Pass your component's name in declare_component in __init__.py
  • Change _RELEASE to True in __init__.py
  • Edit MANIFEST.in, change the path for recursive-include from package/frontend/dist * to <component name>/frontend/dist *
  • Edit setup.py and provide the relevant info about your component
  • Run from your frontend folder
$ yarn run build

The component is ready to be published. You can follow the tutorials available online on how to build a wheel and publish it to PyPI or it can now be installed directly from github (in which case don't forget to include frontend/dist folder in your repo).

Resources

sd_concept_browser's People

Contributors

codedealer avatar andfanilo avatar dependabot[bot] avatar qualzz avatar linjiejim avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.