{"id":13500635,"url":"https://github.com/anteriovieira/vue-mindmap","last_synced_at":"2025-04-13T02:23:54.143Z","repository":{"id":43537080,"uuid":"117027823","full_name":"anteriovieira/vue-mindmap","owner":"anteriovieira","description":"VueMindmap is a vue component for mindnode maps","archived":false,"fork":false,"pushed_at":"2020-10-30T23:06:49.000Z","size":197,"stargazers_count":604,"open_issues_count":7,"forks_count":108,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-04T04:43:26.313Z","etag":null,"topics":["d3","mindmap","vue"],"latest_commit_sha":null,"homepage":"https://codesandbox.io/s/jv7pl7wn15","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anteriovieira.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-11T00:21:04.000Z","updated_at":"2025-03-14T23:27:06.000Z","dependencies_parsed_at":"2022-07-15T07:48:00.146Z","dependency_job_id":null,"html_url":"https://github.com/anteriovieira/vue-mindmap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anteriovieira%2Fvue-mindmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anteriovieira%2Fvue-mindmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anteriovieira%2Fvue-mindmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anteriovieira%2Fvue-mindmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anteriovieira","download_url":"https://codeload.github.com/anteriovieira/vue-mindmap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248655024,"owners_count":21140414,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["d3","mindmap","vue"],"created_at":"2024-07-31T22:01:07.923Z","updated_at":"2025-04-13T02:23:54.116Z","avatar_url":"https://github.com/anteriovieira.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","UI组件","Components \u0026 Libraries","UI Components [🔝](#readme)","UI Components"],"sub_categories":["杂","UI Components","Miscellaneous"],"readme":"# VueMindmap\n\n[![npm](https://img.shields.io/npm/v/vue-mindmap.svg)](https://www.npmjs.com/package/vue-mindmap) [![vue2](https://img.shields.io/badge/vue-2.x-brightgreen.svg)](https://vuejs.org/)\n\n\u003e VueMindmap is a vue component for mindnode maps inspired by [react-mindmap](https://github.com/learn-anything/react-mindmap).\n\n[Live demo](https://codesandbox.io/s/jv7pl7wn15) built on top of the awesome [codesandbox](https://codesandbox.io).\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"vue-mindmap\" src=\"https://raw.githubusercontent.com/anteriovieira/vue-mindmap/master/media/mindmap.png\" /\u003e\n\u003c/p\u003e\n\n\n## Installation\n\n```bash\nnpm install --save vue-mindmap\n```\n\n## Usage\n\n### Bundler (Webpack, Rollup)\n\n```js\nimport Vue from 'vue'\nimport VueMindmap from 'vue-mindmap'\n// You need a specific loader for CSS files like https://github.com/webpack/css-loader\nimport 'vue-mindmap/dist/vue-mindmap.css'\n\nVue.use(VueMindmap)\n```\n\n```html\n\u003ctemplate\u003e\n  \u003cmindmap\n    :nodes=\"nodes\"\n    :connections=\"connections\"\n    :editable=\"true\"\n  /\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\n  export default {\n    name: 'MyMindmap',\n    data() {\n      return {\n        nodes: [...],\n        connections: [...]\n      }\n    }\n  }\n\u003c/script\u003e\n```\n\n### Browser\n\n```html\n\u003c!-- Include after Vue --\u003e\n\u003c!-- Local files --\u003e\n\u003clink rel=\"stylesheet\" href=\"vue-mindmap/dist/vue-mindmap.css\"\u003e\u003c/link\u003e\n\u003cscript src=\"vue-mindmap/dist/vue-mindmap.js\"\u003e\u003c/script\u003e\n\n\u003c!-- From CDN --\u003e\n\u003clink rel=\"stylesheet\" href=\"https://unpkg.com/vue-mindmap/dist/vue-mindmap.css\"\u003e\u003c/link\u003e\n\u003cscript src=\"https://unpkg.com/vue-mindmap\"\u003e\u003c/script\u003e\n```\n\n\n## Props\n\n| Prop            | Type    | Default | Description                                            |\n|-----------------|:-------:|---------|--------------------------------------------------------|\n| **nodes**       | Array   | [ ]      | Array of objects used to render nodes.                |\n| **connections** | Array   | [ ]      | Array of objects used to render connections.          |\n| **subnodes**    | Array   | [ ]      | Array of objects used to render subnodes.             |\n| **editable**    | Boolean | false   | Enable editor mode, which allows to move around nodes. |\n\n### nodes\n\nArray of objects used to render nodes. Below an example of the node structure.\n\n```json\n{\n  \"text\": \"python\",\n  \"url\": \"http://www.wikiwand.com/en/Python_(programming_language)\",\n  \"fx\": -13.916222252976013,\n  \"fy\": -659.1641376795345,\n  \"category\": \"wiki\",\n  \"note\": \"\"\n}\n```\n\nThe possible attributes are:\n\n- **text**: title of the node\n- **url**: url contained in the node\n- **fx** and **fy**: coordinates (if not present they'll be generated)\n- **category**: category used to generate an emoji\n- **note**: note that will be visible on hover\n\n### connections\n\nArray of objects used to render connections. Below an example of the connection\nstructure.\n\n```json\n{\n  \"source\": \"python\",\n  \"target\": \"basics\",\n  \"curve\": {\n    \"x\": -43.5535,\n    \"y\": 299.545\n  }\n}\n```\n\nThe possible attributes are:\n\n- **source**: title of the node where the connection starts\n- **target**: title of the node where the connection ends\n- **curve.x** and **curve.y**: coordinates of the control point of a quadratic bezier curve\n(if not specified the connection will be straight)\n\n### subnodes\nArray of objects used to render subnodes. The structure is the same as for nodes\nwith two additional attributes:\n\n- **parent**: title of the parent node\n- **color**: used for the margin color, needs to be a valid CSS color\n\n\n## Styling\nHere's a list of all CSS classes for styling:\n\n- **.mindmap-svg**: main `svg` element containing the map;\n- **.mindmap-node**: `foreignObject` element representing a node;\n- **.mindmap-node--editable**: `foreignObject` element representing a node in editor mode;\n- **.mindmap-subnode-group-text**: `foreignObject` element containing all subnodes of a given node;\n- **.mindmap-subnode-text**: `div` element containing a subnode;\n- **.mindmap-connection**: `path` element for each connection;\n- **.mindmap-emoji**: `img` tag for emoji\n\n## Development\n\n### Launch visual tests\n\n```bash\nnpm run dev\n```\n\n### Launch Karma with coverage\n\n```bash\nnpm run dev:coverage\n```\n\n### Build\n\nBundle the js and css of to the `dist` folder:\n\n```bash\nnpm run build\n```\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanteriovieira%2Fvue-mindmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanteriovieira%2Fvue-mindmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanteriovieira%2Fvue-mindmap/lists"}