Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
2297fc3
first test commit
Oct 13, 2022
88fdfe0
scope and dashboard positions
Oct 20, 2022
326a301
data processed
Oct 21, 2022
a023925
add selecting
Oct 21, 2022
1aa3c8b
bottom bar success
Oct 21, 2022
7fca463
import sunburst error
Oct 21, 2022
f5b687e
sunburst success
Oct 21, 2022
952adf4
runable
Oct 21, 2022
0d49371
all works
Oct 22, 2022
121fdd8
write readme
Oct 22, 2022
3d2ce54
brush cannot work
Nov 2, 2022
38c3b49
first submit
Nov 2, 2022
5e6de63
bursh works now
Nov 2, 2022
eecddec
basic framework of project
Dec 5, 2022
e6de027
modified barchart, add linechart
Dec 5, 2022
52de028
modified barchart, add linechart
Dec 5, 2022
f5b2170
solve scale issue
Dec 5, 2022
ce9079a
fix brushing selections
Dec 5, 2022
938c2f4
pie chart data update
Dec 5, 2022
b67fba6
update test.json
ZhennanWu Dec 5, 2022
8a201c0
bar chart
ZhennanWu Dec 5, 2022
33db660
Merge pull request #1 from ZhennanWu/main
Dec 5, 2022
fffeff1
bar chart working
ZhennanWu Dec 5, 2022
f529005
Merge pull request #2 from ZhennanWu/main
Dec 5, 2022
8053450
add page 3
Dec 5, 2022
39e4689
fix const bug
Dec 6, 2022
c30dc6d
fix const bug
ZhennanWu Dec 6, 2022
b474c3a
company -> enterprise
ZhennanWu Dec 6, 2022
49a15d4
scatter plot
Dec 6, 2022
14a043c
radar axis
Dec 6, 2022
3761ab3
bubble chart
ZhennanWu Dec 6, 2022
ba68b23
reset page2
Dec 6, 2022
7656f4e
new pages
Dec 6, 2022
293b821
change size and look
Dec 6, 2022
68aefa9
change size and look
Dec 6, 2022
f236f62
datasets
ZhennanWu Dec 6, 2022
7eef0aa
pie no problem
Dec 6, 2022
a1700b5
pie no problem
Dec 6, 2022
9545190
pie chart datas
ZhennanWu Dec 6, 2022
f0b272a
scatter page
Dec 6, 2022
712adbc
try sunburst json
Dec 6, 2022
41f2e5e
sunburst json format
Dec 6, 2022
4071597
sunburst json format
Dec 6, 2022
d4f9b3c
bubble chart update
ZhennanWu Dec 6, 2022
df6595f
problematic second screen
ZhennanWu Dec 6, 2022
830ce00
fix table interactivty
ZhennanWu Dec 6, 2022
66d4682
fix second screen
ZhennanWu Dec 6, 2022
8402ec0
adjust scatter
Dec 6, 2022
ca4c2c8
scatter plot
Dec 6, 2022
9ddca68
third screen
ZhennanWu Dec 6, 2022
076f259
trend first prototype
ZhennanWu Dec 6, 2022
9cc4df2
final
ZhennanWu Dec 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions Homework2/Vue-Skeleton/src/views/components/piechart.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<template>
<div id="pieWrapper" class="pieChartContainer">
<svg id="myPieChart" :height="height" :width="width"> </svg>
</div>
</template>

<script>
import * as d3 from "d3";
import { piefunction } from "./myTestFunction"

export default {
name: 'PieChart',
componets: {},
data() {
return {
pieData: [
{date: 1910, count: 14},
{date: 1920, count: 20},
{date: 1930, count: 42},
{date: 1940, count: 94},
{date: 1950, count: 344},
{date: 1960, count: 54},
{date: 1970, count: 124}
],
arc: null,
arcs: [],
color: null,
pie: null,
arcLabel: null,
width: 500,
height: 500,
}
},
props: {
myPieData: Array,
},
created() {
/* we DO NOT have access to the HTML in Template */
// MAYBE DATA PROCESSING OR FETCHING DATA HERE
piefunction();
},
mounted() {
/* We have access to our HTML defined in Template*/
// D3 CODE CALLED HERE\
this.init(this.pieData);
this.drawPie(this.pieData);
},
methods: {
init(data) {
this.arc = d3.arc()
.innerRadius(20)
.outerRadius(Math.min(this.width, this.height) / 2 - 1)

this.color = d3.scaleOrdinal()
.domain(data.map(d => d.date))
.range(d3.quantize(t => d3.interpolateSpectral(t * 0.8 + 0.1), data.length).reverse())

this.pie = d3.pie()
.sort(null)
.value(d => d.count)

const radius = Math.min(this.width, this.height) / 2 * 0.8;
this.arcLabel = d3.arc().innerRadius(radius).outerRadius(radius)

let svg = d3.select("#myPieChart");
svg.append("g").attr("id", "pieGroup").attr("transform", `translate(${this.width / 2},${this.height / 2})`)
svg.append("g").attr("id", "pieLabelGroup")
},
drawPie(data) {
let arcs = this.pie(data);
let svg = d3.select("#pieGroup");

let vueThis = this;
svg.attr("stroke", "white")
.selectAll("path")
.data(arcs)
.join("path")
.attr("fill", d => this.color(d.data.date))
.attr("d", this.arc)
.on("click",function(e,d,i){
console.log("CLICKED THIS", e,d,i)
vueThis.$emit("TellParentSTuff", d)
});


d3.select("pieLabelGroup")
.attr("font-family", "sans-serif")
.attr("font-size", 17)
.attr("text-anchor", "middle")
.selectAll("text")
.data(arcs)
.join("text")
.attr("transform", d => `translate(${this.arcLabel.centroid(d)})`)
.text(function (d) { return d.data.date });
}
}
}
</script>

<style scoped>
.pieChartContainer {
background-color: grey;
height: 100%;
}
</style>
2 changes: 1 addition & 1 deletion Homework2/Vue-Skeleton/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"include": [
"./src/**/*"
],
, "../orzwang/src/views/components/dropdown.vue.ts" ],
"exclude": [
"./node_modules",
"./src/store/**/*"
Expand Down
5 changes: 5 additions & 0 deletions Homework2/orzwang/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"include": [
"./src/**/*"
]
}
Loading