Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #162 from familytree365/Adil-dev
Browse files Browse the repository at this point in the history
Adil dev
  • Loading branch information
curtisdelicata authored Nov 6, 2021
2 parents 5f0c9d4 + a9d1a83 commit 18aaac7
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 7 deletions.
32 changes: 30 additions & 2 deletions pages/chart/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<enso-table class="box is-paddingless raises-on-hover" id="notes" />
<!-- <enso-table class="box is-paddingless raises-on-hover" id="notes" /> -->
<div id="webtrees-pedigree-chart-container"></div>
</template>

<router>
Expand All @@ -9,7 +10,7 @@
</router>
<script>
import { EnsoTable } from "@enso-ui/tables/bulma";
import { PedigreeChart } from "/assets/js/modules/index";
export default {
layout: "auth",
meta: {
Expand All @@ -18,6 +19,33 @@ export default {
},
components: { EnsoTable },
methods: {
fetchData() {
this.$axios
.$get("/api/trees/show")
// .then((res) => res.json())
.then((res) => {
const pedigreeChart = new PedigreeChart(
"webtrees-pedigree-chart-container",
{
labels: ["zoom", "move"],
generations: 4,
defaultColor: "#0000FF",
fontColor: "#0000FF",
showEmptyBoxes: "up",
treeLayout: "right",
rtl: "rtl",
}
);
pedigreeChart.cssFile = "/assets/css/svg.css";
// Draw chart
pedigreeChart.draw(res.data);
});
},
},
mounted() {
this.fetchData();
},
};
</script>

Expand Down
8 changes: 3 additions & 5 deletions pages/chart/show.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template>
<div>
<div id="tree"></div>
<div id="tree">dd</div>
</div>
</template>
<router>
{
name: 'charts.show'
name: 'tree.show'
}
</router>

Expand All @@ -22,7 +22,7 @@ export default {
.then((res) => res.json())
.then((res) => {
const pedigreeChart = new WebtreesPedigreeChart.PedigreeChart(
"#webtrees-pedigree-chart-container",
"#tree",
{
labels: chartParams.labels,
generations: optionGenerations,
Expand All @@ -33,9 +33,7 @@ export default {
rtl: chartParams.rtl,
}
);
pedigreeChart.cssFile = "/assets/css/svg.css";
// Draw chart
pedigreeChart.draw(res.data);
});
Expand Down
76 changes: 76 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import resolve from '@rollup/plugin-node-resolve';
import { terser } from "rollup-plugin-terser";

export default [
// pedigree-chart.js
{
input: "assets/js/modules/index.js",
output: [
{
name: "WebtreesPedigreeChart",
file: "assets/js/pedigree-chart.js",
format: "umd"
}
],
plugins: [
resolve()
]
},
{
input: "assets/js/modules/index.js",
output: [
{
name: "WebtreesPedigreeChart",
file: "assets/js/pedigree-chart.min.js",
format: "umd"
}
],
plugins: [
resolve(),
terser({
mangle: true,
compress: true,
module: true,
output: {
comments: false
}
})
]
},

// pedigree-chart-storage.js
{
input: "assets/js/modules/storage.js",
output: [
{
name: "WebtreesPedigreeChart",
file: "assets/js/pedigree-chart-storage.js",
format: "umd"
}
],
plugins: [
resolve()
]
},
{
input: "assets/js/modules/storage.js",
output: [
{
name: "WebtreesPedigreeChart",
file: "assets/js/pedigree-chart-storage.min.js",
format: "umd"
}
],
plugins: [
resolve(),
terser({
mangle: true,
compress: true,
module: true,
output: {
comments: false
}
})
]
}
];

0 comments on commit 18aaac7

Please sign in to comment.