Repository: bbonnin/vue-morris
Branch: master
Commit: a03d8bc41cf6
Files: 15
Total size: 20.2 KB
Directory structure:
gitextract_1gpywlcm/
├── .babelrc
├── .gitignore
├── LICENSE
├── README.md
├── build/
│ ├── webpack.base.conf.js
│ ├── webpack.build.conf.js
│ └── webpack.dev.conf.js
├── package.json
└── src/
├── components/
│ ├── area-chart.vue
│ ├── bar-chart.vue
│ ├── chart-mixins.js
│ ├── donut-chart.vue
│ └── line-chart.vue
├── index.js
└── util/
└── converter.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .babelrc
================================================
{
"presets": ["es2015"],
"plugins": ["transform-runtime"],
"comments": false
}
================================================
FILE: .gitignore
================================================
node_modules
*.log
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2016 Bruno Bonnin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# vue-morris
> Vue.js components wrapping Morris.js lib
>
> See http://morrisjs.github.io/morris.js/ for documentation
> Depends on Vue.js v2.1.0+
## Install
Use npm
```bash
npm install vue-morris --save
```
Do not forget to declare jQuery in your `package.json` and, if you are using Webpack, you should have something like that in your `webpack.config.js`
```javascript
resolve: {
alias: {
'vue$': 'vue/dist/vue.common.js',
'jquery': 'jquery/src/jquery.js'
}
},
```
## Examples
For a complete example, see files in `examples` directory or the project: https://github.com/bbonnin/vue-morris-example.
* Import the component
```javascript
// Do not forget to import raphael
import Raphael from 'raphael/raphael'
global.Raphael = Raphael
import Vue from 'vue'
import { DonutChart } from 'vue-morris'
new Vue({
el: '#app',
data: {
donutData: [
{ label: 'Red', value: 300 },
{ label: 'Blue', value: 50 },
{ label: 'Yellow', value: 100 }
],
components: {
DonutChart, BarChart, LineChart, AreaChart
}
})
```
* Use the component in html
```html
<donut-chart
id="donut"
:data="donutData"
colors='[ "#FF6384", "#36A2EB", "#FFCE56" ]'
resize="true">
</donut-chart>
```
* Bar chart

* Line chart

* Area chart

* Donut chart

## Build Setup
``` bash
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
```
================================================
FILE: build/webpack.base.conf.js
================================================
var path = require('path')
module.exports = {
entry: {
'vue-morris': './src/index.js'
},
output: {
path: path.resolve(__dirname, '../dist'),
publicPath: '/dist/',
//library: 'VueMorris',
//libraryTarget: 'amd',
filename: process.env.NODE_ENV === 'production' ? '[name].min.js' : '[name].js'
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
// vue-loader options go here
}
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
},
{
test: /\.css$/,
loader: 'vue-style-loader!css-loader'
}
]
}
}
================================================
FILE: build/webpack.build.conf.js
================================================
var webpack = require('webpack')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
baseWebpackConfig.output.library = 'VueMorris'
baseWebpackConfig.output.libraryTarget = 'amd'
module.exports = merge(baseWebpackConfig, {
devtool: '#source-map',
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
compress: {
warnings: false
}
}),
new webpack.LoaderOptionsPlugin({
minimize: true
})
]
})
================================================
FILE: build/webpack.dev.conf.js
================================================
var webpack = require('webpack')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var HtmlWebpackPlugin = require('html-webpack-plugin')
baseWebpackConfig.entry.examples = './examples/main.js'
module.exports = merge(baseWebpackConfig, {
devServer: {
historyApiFallback: true,
noInfo: true
},
devtool: '#eval-source-map',
resolve: {
alias: {
'vue$': 'vue/dist/vue.common.js',
'jquery': 'jquery/src/jquery.js'/*,
'raphael': 'raphael/raphael.js'*/
}
},
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery'/*,
Raphael: 'raphael'*/
}),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"development"'
}
}),
new HtmlWebpackPlugin({
filename: './examples/index.html',
inject: false
})
]
})
================================================
FILE: package.json
================================================
{
"name": "vue-morris",
"description": "Vue.js component wrapping Morris.js lib",
"version": "1.1.0",
"author": "Bruno Bonnin <bbonnin@gmail.com>",
"private": false,
"keywords": [
"vue",
"vuejs",
"morris.js"
],
"main": "dist/vue-morris.min.js",
"repository": {
"type": "git",
"url": "https://github.com/bbonnin/vue-morris.git"
},
"bugs": "https://github.com/bbonnin/vue-morris/issues",
"scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --content-base ./examples --open --inline --hot --colors --config build/webpack.dev.conf.js",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules --colors --config build/webpack.build.conf.js"
},
"dependencies": {
"babel-runtime": "^6.0.0",
"morris.js": "github:morrisjs/morris.js",
"raphael": "^2.2.7",
"vue": "^2.1.0"
},
"devDependencies": {
"babel-core": "^6.0.0",
"babel-loader": "^6.0.0",
"babel-plugin-transform-runtime": "^6.0.0",
"babel-preset-es2015": "^6.0.0",
"cross-env": "^3.0.0",
"css-loader": "^0.25.0",
"file-loader": "^0.9.0",
"html-webpack-plugin": "^2.24.1",
"vue-loader": "^10.0.0",
"vue-style-loader": "^1.0.0",
"vue-template-compiler": "^2.1.0",
"webpack": "^2.1.0-beta.25",
"webpack-dev-server": "^2.11.5",
"webpack-merge": "^2.3.1"
},
"peerDependencies": {
"jquery": "^3.0.0"
},
"license": "MIT"
}
================================================
FILE: src/components/area-chart.vue
================================================
<template>
<div :id="id"></div>
</template>
<script>
import 'morris.js/morris'
import 'morris.js/morris.css'
import Converter from '../util/converter'
import ChartProps from './chart-mixins'
export default {
name: 'area-chart',
mixins: [ ChartProps.area ],
data () {
return {
chart: null
}
},
watch: {
data (val) {
this.$nextTick(() => {
this.chart.options.labels = Converter.toObject(this.labels)
this.chart.options.xkey = this.xkey
this.chart.options.ykeys = Converter.toObject(this.ykeys)
if (this['lineColors']) {
this.chart.options['lineColors'] = Converter.toObject(this['lineColors'])
}
this.chart.setData(Converter.toObject(this.data))
})
}
},
mounted () {
let options = {
element: this.id,
data: Converter.toObject(this.data),
resize: Converter.toBoolean(this.resize),
labels: Converter.toObject(this.labels),
xkey: this.xkey,
ykeys: Converter.toObject(this.ykeys),
grid: Converter.toBoolean(this.grid),
gridTextColor: this.gridTextColor,
gridTextSize: Converter.toInt(this.gridTextSize),
gridTextFamily: this.gridTextFamily,
gridTextWeight: this.gridTextWeight,
lineWidth: this.lineWidth,
pointSize: this.pointSize,
ymax: this.ymax,
ymin: this.ymin,
smooth: Converter.toBoolean(this.smooth),
hideHover: this.hideHover,
parseTime: Converter.toBoolean(this.parseTime),
postUnits: this.postUnits,
preUnits: this.preUnits,
xLabelAngle: this.xLabelAngle,
goalStrokeWidth: this.goalStrokeWidth,
eventStrokeWidth: this.eventStrokeWidth,
fillOpacity: this.fillOpacity,
behaveLikeLine: this.behaveLikeLine
}
this.addOptionAsObject('lineColors', options)
this.addOption('xLabels', options)
this.addOptionAsObject('pointFillColors', options)
this.addOptionAsObject('pointStrokeColors', options)
this.addOption('dateFormat', options)
this.addOption('xLabelFormat', options)
this.addOption('yLabelFormat', options)
this.addOptionAsObject('goals', options)
this.addOptionAsObject('goalLineColors', options)
this.addOptionAsObject('events', options)
this.addOptionAsObject('eventLineColors', options)
this.addOption('hoverCallback', options)
this.chart = Morris.Area(options)
}
}
</script>
================================================
FILE: src/components/bar-chart.vue
================================================
<template>
<div :id="id"></div>
</template>
<script>
import 'morris.js/morris'
import 'morris.js/morris.css'
import Converter from '../util/converter'
import ChartProps from './chart-mixins'
export default {
name: 'bar-chart',
mixins: [ ChartProps.bar ],
data () {
return {
chart: null
}
},
watch: {
data (val) {
this.$nextTick(() => {
this.chart.options.labels = Converter.toObject(this.labels)
this.chart.options.xkey = this.xkey
this.chart.options.ykeys = Converter.toObject(this.ykeys)
if (this['barColors']) {
this.chart.options['barColors'] = Converter.toObject(this['barColors'])
}
this.chart.setData(this.data)
})
}
},
mounted () {
let options = {
element: this.id,
data: Converter.toObject(this.data),
labels: Converter.toObject(this.labels),
resize: Converter.toBoolean(this.resize),
xkey: this.xkey,
ykeys: Converter.toObject(this.ykeys),
axes: Converter.toBoolean(this.axes),
ymax: this.ymax,
ymin: this.ymin,
hideHover: this.hideHover,
horizontal: Converter.toBoolean(this.horizontal),
stacked: Converter.toBoolean(this.stacked),
grid: Converter.toBoolean(this.grid),
gridTextColor: this.gridTextColor,
gridTextSize: Converter.toInt(this.gridTextSize),
gridTextFamily: this.gridTextFamily,
gridTextWeight: this.gridTextWeight,
xLabelAngle: this.xLabelAngle,
lineWidth: this.lineWidth,
pointSize: this.pointSize
}
this.addOptionAsObject('barColors', options)
this.addOption('xLabelFormat', options)
this.addOption('yLabelFormat', options)
this.addOption('hoverCallback', options)
this.chart = Morris.Bar(options)
}
}
</script>
================================================
FILE: src/components/chart-mixins.js
================================================
import Converter from '../util/converter'
/**
* All properties used by the charts with their constraints.
*/
const Props = {
id: { type: String, required: true },
data: { type: [ String, Array ], required: true },
barColors: { type: [ String, Array, Function ], required: false },
xkey: { type: String, required: false, default: 'key' },
ykeys: { type: [ String, Array ], required: false, default: function _default() { return ['value']; }},
labels: { type: [ String, Array ], required: false, default: function _default() { return ['Value']; }},
hoverCallback: { type: Function, required: false },
axes: { type: [ Boolean, String ], required: false, default: true },
hideHover: { type: String, required: false },
stacked: { type: [ Boolean, String ], required: false },
resize: { type: [ Boolean, String ], required: false },
horizontal: { type: [ Boolean, String ], required: false, default: false },
grid: { type: [ Boolean, String ], required: false, default: true },
gridTextColor: { type: String, required: false, default: '#888' },
gridTextSize: { type: [ Number, String ], required: false, default: 12 },
gridTextFamily: { type: String, required: false, default: 'sans-serif' },
gridTextWeight: { type: String, required: false, default: 'normal' },
colors: { type: [ String, Array ], required: false },
formatter: { type: Function, required: false },
lineColors: { type: [ String, Array, Function ], required: false },
xLabels: { type: String, required: false },
lineWidth: { type: [ Number, String ], required: false },
pointSize: { type: [ Number, String ], required: false },
pointFillColors: { type: [ String, Array ], required: false },
pointStrokeColors: { type: [ String, Array ], required: false },
ymax: { type: String, required: false },
ymin: { type: String, required: false },
smooth: { type: [ Boolean, String ], required: false, default: true },
parseTime: { type: [ Boolean, String ], required: false, default: true },
postUnits: { type: String, required: false },
preUnits: { type: String, required: false },
dateFormat: { type: Function, required: false },
xLabelFormat: { type: Function, required: false },
yLabelFormat: { type: Function, required: false },
xLabelAngle: { type: String, required: false },
goals: { type: [ String, Array ], required: false },
goalStrokeWidth: { type: [ Number, String ], required: false },
goalLineColors: { type: [ String, Array ], required: false },
events: { type: [ String, Array ], required: false },
eventStrokeWidth: { type: String, required: false },
eventLineColors: { type: [ String, Array ], required: false },
fillOpacity: { type: String, required: false },
behaveLikeLine: { type: [ Boolean, String ], required: false, default: false }
}
/**
* Properties of a bar chart.
*/
const BarProps = {
id: Props.id,
data: Props.data,
barColors: Props.barColors,
xkey: Props.xkey,
ykeys: Props.ykeys,
labels: Props.labels,
xLabelFormat: Props.xLabelFormat,
yLabelFormat: Props.yLabelFormat,
xLabelAngle: Props.xLabelAngle,
hoverCallback: Props.hoverCallback,
grid: Props.grid,
horizontal: Props.horizontal,
axes: Props.axes,
hideHover: Props.hideHover,
stacked: Props.stacked,
resize: Props.resize,
ymax: Props.ymax,
ymin: Props.ymin,
gridTextColor: Props.gridTextColor,
gridTextSize: Props.gridTextSize,
gridTextFamily: Props.gridTextFamily,
gridTextWeight: Props.gridTextWeight
}
/**
* Properties of a donut chart.
*/
const DonutProps = {
id: Props.id,
data: Props.data,
colors: Props.colors,
formatter: Props.formatter,
resize: Props.resize
}
/**
* Properties of a line chart.
*/
const LineProps = {
id: Props.id,
data: Props.data,
resize: Props.resize,
lineColors: Props.lineColors,
xkey: Props.xkey,
ykeys: Props.ykeys,
labels: Props.labels,
xLabels: Props.xLabels,
grid: Props.grid,
gridTextColor: Props.gridTextColor,
gridTextSize: Props.gridTextSize,
gridTextFamily: Props.gridTextFamily,
gridTextWeight: Props.gridTextWeight,
lineWidth: Props.lineWidth,
pointSize: Props.pointSize,
pointFillColors: Props.pointFillColors,
pointStrokeColors: Props.pointStrokeColors,
ymax: Props.ymax,
ymin: Props.ymin,
smooth: Props.smooth,
hideHover: Props.hideHover,
parseTime: Props.parseTime,
postUnits: Props.postUnits,
preUnits: Props.preUnits,
dateFormat: Props.dateFormat,
xLabelFormat: Props.xLabelFormat,
yLabelFormat: Props.yLabelFormat,
xLabelAngle: Props.xLabelAngle,
goals: Props.goals,
goalStrokeWidth: Props.goalStrokeWidth,
goalLineColors: Props.goalLineColors,
events: Props.events,
eventStrokeWidth: Props.eventStrokeWidth,
eventLineColors: Props.eventLineColors,
fillOpacity: Props.fillOpacity,
hoverCallback: Props.hoverCallback
}
/**
* Properties of an area chart.
*/
const AreaProps = {
behaveLikeLine: Props.behaveLikeLine
}
for (var prop in LineProps) {
if (LineProps.hasOwnProperty(prop)) {
AreaProps[prop] = LineProps[prop];
}
}
/**
* Common methods for all the charts.
*/
const ChartMethods = {
addOption (name, options) {
if (this[name]) {
options[name] = this[name]
}
},
addOptionAsObject (name, options) {
if (this[name]) {
options[name] = Converter.toObject(this[name])
}
}
}
export default {
bar: {
props: BarProps,
methods: ChartMethods
},
donut: {
props: DonutProps,
methods: ChartMethods
},
line: {
props: LineProps,
methods: ChartMethods
},
area: {
props: AreaProps,
methods: ChartMethods
}
}
================================================
FILE: src/components/donut-chart.vue
================================================
<template>
<div :id="id"></div>
</template>
<script>
import 'morris.js/morris'
import 'morris.js/morris.css'
import Converter from '../util/converter'
import ChartProps from './chart-mixins'
export default {
name: 'donut-chart',
mixins: [ ChartProps.donut ],
data () {
return {
chart: null
}
},
watch: {
data (val) {
this.$nextTick(() => {
if (this.data && this.data.length > 0 && !this.chart) {
this.createChart ()
}
if (this.chart) {
if (this['colors']) {
this.chart.options['colors'] = Converter.toObject(this['colors'])
}
this.chart.setData(Converter.toObject(this.data))
}
})
}
},
mounted () {
if (this.data && this.data.length > 0) {
this.createChart()
}
},
methods: {
createChart () {
let options = {
element: this.id,
data: Converter.toObject(this.data),
resize: Converter.toBoolean(this.resize)
}
this.addOptionAsObject('colors', options)
this.addOption('formatter', options)
this.chart = Morris.Donut(options)
}
}
}
</script>
================================================
FILE: src/components/line-chart.vue
================================================
<template>
<div :id="id"></div>
</template>
<script>
import 'morris.js/morris'
import 'morris.js/morris.css'
import Converter from '../util/converter'
import ChartProps from './chart-mixins'
export default {
name: 'line-chart',
mixins: [ ChartProps.line ],
data () {
return {
chart: null
}
},
watch: {
data (val) {
this.$nextTick(() => {
this.chart.options.labels = Converter.toObject(this.labels)
this.chart.options.xkey = this.xkey
this.chart.options.ykeys = Converter.toObject(this.ykeys)
if (this['lineColors']) {
this.chart.options['lineColors'] = Converter.toObject(this['lineColors'])
}
this.chart.setData(Converter.toObject(this.data))
})
}
},
mounted () {
let options = {
element: this.id,
data: Converter.toObject(this.data),
resize: Converter.toBoolean(this.resize),
labels: Converter.toObject(this.labels),
xkey: this.xkey,
ykeys: Converter.toObject(this.ykeys),
grid: Converter.toBoolean(this.grid),
gridTextColor: this.gridTextColor,
gridTextSize: Converter.toInt(this.gridTextSize),
gridTextFamily: this.gridTextFamily,
gridTextWeight: this.gridTextWeight,
lineWidth: this.lineWidth,
pointSize: this.pointSize,
ymax: this.ymax,
ymin: this.ymin,
smooth: Converter.toBoolean(this.smooth),
hideHover: this.hideHover,
parseTime: Converter.toBoolean(this.parseTime),
postUnits: this.postUnits,
preUnits: this.preUnits,
xLabelAngle: this.xLabelAngle,
goalStrokeWidth: this.goalStrokeWidth,
eventStrokeWidth: this.eventStrokeWidth,
fillOpacity: this.fillOpacity
}
this.addOptionAsObject('lineColors', options)
this.addOption('xLabels', options)
this.addOptionAsObject('pointFillColors', options)
this.addOptionAsObject('pointStrokeColors', options)
this.addOption('dateFormat', options)
this.addOption('xLabelFormat', options)
this.addOption('yLabelFormat', options)
this.addOptionAsObject('goals', options)
this.addOptionAsObject('goalLineColors', options)
this.addOptionAsObject('events', options)
this.addOptionAsObject('eventLineColors', options)
this.addOption('hoverCallback', options)
this.chart = Morris.Line(options)
}
}
</script>
================================================
FILE: src/index.js
================================================
import DonutChart from './components/donut-chart.vue'
import BarChart from './components/bar-chart.vue'
import LineChart from './components/line-chart.vue'
import AreaChart from './components/area-chart.vue'
const VueMorris = {
DonutChart, BarChart, LineChart, AreaChart
}
module.exports = VueMorris
================================================
FILE: src/util/converter.js
================================================
const Converter = {
toObject: function (data) {
if (typeof data === 'string') {
return JSON.parse(data)
}
return data
},
toBoolean: function (data) {
if (typeof data === 'string') {
return data === 'true'
}
return data
},
toInt: function(data) {
if (typeof data === 'string') {
return parseInt(data)
}
return data
},
}
module.exports = Converter
gitextract_1gpywlcm/
├── .babelrc
├── .gitignore
├── LICENSE
├── README.md
├── build/
│ ├── webpack.base.conf.js
│ ├── webpack.build.conf.js
│ └── webpack.dev.conf.js
├── package.json
└── src/
├── components/
│ ├── area-chart.vue
│ ├── bar-chart.vue
│ ├── chart-mixins.js
│ ├── donut-chart.vue
│ └── line-chart.vue
├── index.js
└── util/
└── converter.js
SYMBOL INDEX (2 symbols across 1 files)
FILE: src/components/chart-mixins.js
method addOption (line 153) | addOption (name, options) {
method addOptionAsObject (line 159) | addOptionAsObject (name, options) {
Condensed preview — 15 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (22K chars).
[
{
"path": ".babelrc",
"chars": 84,
"preview": "{\n \"presets\": [\"es2015\"],\n \"plugins\": [\"transform-runtime\"],\n \"comments\": false\n}"
},
{
"path": ".gitignore",
"chars": 19,
"preview": "node_modules\n*.log\n"
},
{
"path": "LICENSE",
"chars": 1069,
"preview": "MIT License\n\nCopyright (c) 2016 Bruno Bonnin\n\nPermission is hereby granted, free of charge, to any person obtaining a co"
},
{
"path": "README.md",
"chars": 1619,
"preview": "# vue-morris\n\n> Vue.js components wrapping Morris.js lib\n> \n> See http://morrisjs.github.io/morris.js/ for documentation"
},
{
"path": "build/webpack.base.conf.js",
"chars": 847,
"preview": "var path = require('path')\n\nmodule.exports = {\n entry: {\n 'vue-morris': './src/index.js'\n },\n output: {\n path: "
},
{
"path": "build/webpack.build.conf.js",
"chars": 605,
"preview": "var webpack = require('webpack')\nvar merge = require('webpack-merge')\nvar baseWebpackConfig = require('./webpack.base.co"
},
{
"path": "build/webpack.dev.conf.js",
"chars": 875,
"preview": "var webpack = require('webpack')\nvar merge = require('webpack-merge')\nvar baseWebpackConfig = require('./webpack.base.co"
},
{
"path": "package.json",
"chars": 1445,
"preview": "{\n \"name\": \"vue-morris\",\n \"description\": \"Vue.js component wrapping Morris.js lib\",\n \"version\": \"1.1.0\",\n \"author\": "
},
{
"path": "src/components/area-chart.vue",
"chars": 2423,
"preview": "<template>\n <div :id=\"id\"></div>\n</template>\n\n<script>\nimport 'morris.js/morris'\nimport 'morris.js/morris.css'\nimport C"
},
{
"path": "src/components/bar-chart.vue",
"chars": 1807,
"preview": "<template>\n <div :id=\"id\"></div>\n</template>\n\n<script>\nimport 'morris.js/morris'\nimport 'morris.js/morris.css'\nimport C"
},
{
"path": "src/components/chart-mixins.js",
"chars": 5630,
"preview": "import Converter from '../util/converter'\n\n/**\n * All properties used by the charts with their constraints.\n */\nconst Pr"
},
{
"path": "src/components/donut-chart.vue",
"chars": 1165,
"preview": "<template>\n <div :id=\"id\"></div>\n</template>\n\n<script>\nimport 'morris.js/morris'\nimport 'morris.js/morris.css'\nimport C"
},
{
"path": "src/components/line-chart.vue",
"chars": 2372,
"preview": "<template>\n <div :id=\"id\"></div>\n</template>\n\n<script>\nimport 'morris.js/morris'\nimport 'morris.js/morris.css'\nimport C"
},
{
"path": "src/index.js",
"chars": 304,
"preview": "import DonutChart from './components/donut-chart.vue'\nimport BarChart from './components/bar-chart.vue'\nimport LineChart"
},
{
"path": "src/util/converter.js",
"chars": 415,
"preview": "const Converter = {\n toObject: function (data) {\n if (typeof data === 'string') {\n return JSON.parse(data)\n "
}
]
About this extraction
This page contains the full source code of the bbonnin/vue-morris GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 15 files (20.2 KB), approximately 5.7k tokens, and a symbol index with 2 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.