webviz配置的核心组件

webviz-core-components的Python项目详细描述


PyPI versionBuild StatusCodacy BadgePython 3.6+

WebVIZ核心组件

webviz_core_components是用于webviz的短划线组件库。

您可以快速开始:

  1. 运行pip install webviz-core-components
  2. 运行python usage.py
  3. 访问网页浏览器中的http://localhost:8050

:warning: The components here are used by webviz-config. In order to facilitate a strong CSP configuration, this package has a side effect of changing the Plotly distribution coming with dash-core-components to one that do not rely on eval(). More specifically it changes from plotly-full to plotly-cartesian bundle. This will be necessary in order to enforce a strong CSP configuration as long as this plotly issue and this dash-core-components issue both are open. Note that this side-effect only takes place if dash-core-components is installed, which is a requirement if the Graph component from this repository is going to be used.

贡献

此项目由 dash-component-boilerplate。 它包含创建自定义短划线组件所需的最小代码集。

安装依赖项

如果在提示期间选择了“安装依赖项”,则可以跳过此部分。

  1. 安装NPM软件包

    npm install
    
  2. 创建一个虚拟环境并激活。

    virtualenv venv
    . venv/bin/activate
    

    注意:venv\scripts\activate for windows

  3. 安装构建组件所需的python包。

    pip install .[dependencies]
    pip install dash[dev]
    
  4. 安装python软件包进行测试(可选)

    pip install .[tests]
    pip install dash[testing]
    

    只要 this ^{} issue is open

src/lib/components/<component_name>.react.js

中编写组件代码
  • 演示应用程序位于src/demo中,您将把示例组件代码导入到演示应用程序中。

  • 在python环境中测试代码:

    1. 构建代码
      npm run build
      
    2. 运行并修改usage.py示例dash应用程序:
      python usage.py
      
  • 为组件编写测试。

    • 样本测试在tests/test_usage.py中可用,它将加载 usage.py然后您就可以自动化与硒的交互。

    • pytest tests运行测试。

    • dash团队广泛使用这些类型的集成测试。 浏览github上的dash组件代码以获取更多测试示例 (例如dash-core-components)。

  • 通过将自定义css文件放入 您的分发文件夹(webviz_subsurface_components)。

    • 确保它们在MANIFEST.in中被引用,以便它们得到 准备发布组件时正确包含。

    • 确保将样式表添加到 webviz_core_components/__init__.py所以dash将为他们服务 在请求组件套件时自动执行。

  • Review your code

编译代码并安装

  1. 生成代码:
    npm run build
    
  2. 安装python包:
    pip install -e .
    

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java无法启动应用程序:JNLP错误   java根据用户输入在PreparedStatement中使用setTime()或setNull()   java EJB与同步   java以object为键通过hashmap进行搜索   java中的模10^9+7   针对包含其他对象的对象的java OOP最佳实践   如何将字符串作为HTML代码从Java文件读取到JSP页面?   java我的POM怎么了?“解析表达式..检测到递归表达式循环”   用于Hbase的Mapreduce的java NoSuchMethodError   JAVAlang.SecurityException:权限拒绝:启动意图{act=安卓.Intent.action.MAIN cat=[安卓.Intent.category.LAUNCHER]   数组初始化谜语Java   通过arraylist搜索时的java句柄关联