2 Star 2 Fork 1

eaglet / vue4_d3v5_forcedirected

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 2.35 KB
一键复制 编辑 原始数据 按行查看 历史
eaglet 提交于 2022-09-15 05:28 . update README.md.

vuecli4 d3v5 力导向图示例(封装组件)

vue d3v5

项目简介

前段时间接到一个项目,参考这个网站https://www.ownthink.com/ (思知),做一个类似功能的知识图谱功能的平台。需要使用D3V5开发,所以就做了这么一个demo程序。 使用d3v5开发的ForceDirected的vue组件,方便灵活使用。

本项目参考官方示例:https://gywgithub.github.io/vue-d3-examples/#/examples/forcedirected

如果觉得本项目能帮助到你,欢迎star支持,谢谢。

项目效果

输入图片说明

框架版本

  1. nodejs v12.16.1
  2. vue/cli 4.4.6
  3. d3/5.16.0

框架结构

    src             --  资源目录
        axios       --  封装axios
        assets      --  静态资源文件
        components  --  组件
        router      --  路由,负责指定页面链接
        service     --  服务层,数据联调,引入请求
        store       --  Vuex
        views       --  视图页面
        main.js     --  入口文件

项目安装

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

项目访问入口

http://localhost:8080/

修改vue默认配置信息

module.exports = {
    // 公共路径(必须有的)
    publicPath: "./",
    // 输出文件目录
    outputDir: "dist",
    // 静态资源存放的文件夹(相对于ouputDir)
    assetsDir: "assets",
    // eslint-loader 是否在保存的时候检查(果断不用,这玩意儿我都没装)
    lintOnSave: false,
    // 我用的only,打包后小些
    runtimeCompiler: false,
    productionSourceMap: true, // 不需要生产环境的设置false可以减小dist文件大小,加速构建

    devServer: {
        open: true,  // npm run serve后自动打开页面
        host: '0.0.0.0',  // 匹配本机IP地址(默认是0.0.0.0)
        port: 8089, // 开发服务器运行端口号
        proxy: null,
    },
}

更新日志

  • 2020年7月24日
  1. 上传demo示例
NodeJS
1
https://gitee.com/e4glet/vue4_d3v5_forcedirected.git
git@gitee.com:e4glet/vue4_d3v5_forcedirected.git
e4glet
vue4_d3v5_forcedirected
vue4_d3v5_forcedirected
master

搜索帮助