Giter Site home page Giter Site logo

openv's Introduction

数据可视化系统

摘要

云组件主要通过组件化的规范来使用,在开发时需要用到es6 class,并绑定在window全局对象上面,易于初始化使用

示例代码

class BarChart {
  constructor (option = {el: String , params: Object || Array, dataset: Object || Array }) {
    this.option = option
  }
  // 实例化
  init ()
  // 更新
  update () {}
  //销毁
  destroy () {}
}

window.BarChart = BarChart
    
  

使用时

// 创建实例

this.chart = new Window[moduleMethodName]({ el: '#' + this.colundID, params: moduleParam.calcRow, dataset: useDate })
// 初始化
this.chart.init()
// 更新
this.chart.update({ el: '#' + this.colundID, params: moduleParam.calcRow, dataset: useDate })
// 销毁
this.chart.destroy()

说明

init

初始化函数:在实例创建完成的时候,进行初始化

参数:

  • el 渲染的元素的Id选择器

  • params 控制页面视图的属性集合 Object 或者 Array

  • dataset 组件的数据集合 Object 或者 Array

update

​ 更新组件: 当组件需要跟新数据和视图的时候使用

​ 参数: 同init

destroy

​ 销毁组件

​ 参数: 不需要

配置文件

{
  // 系统设置
  "system": {
    // 平台名称设置
    "sysname": "数维可视化平台",       
    // 是否可用发布功能
    "publish": 1,
    // 平台LOGO
    "logopath": "./static/assets/img/logo.png"
  },
  // 系统数据配置
  "setting": {
    // 系统数据接口地址  ${server} + '/getUserInfo'
    "server": "http://v2.kwcdev.cn",
    // 大屏实时数据配置
    "realData" : {
      // 实时数据启用方式 websocket http
      "type": "websocket",
      // 实数数据地址
      "url": "ws://192.168.30.189:9090"
    },
    // 三维场景实时数据地址
    "thrdUrl": "ws://192.168.30.189:9508",
    // 是否可以使用本地部署下载功能
    "localDeploy": false,
    // 发布大屏时的一级目录 默认 openv 应与前端包目录同名
    "shareDir": "openv"
  }
}

License

遵循nc开源协议发布,并提供个人免费使用。

openv's People

Contributors

lty628 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.