Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/linked-dashboards/all-d3'
Browse files Browse the repository at this point in the history
  • Loading branch information
jortilles committed Feb 19, 2024
2 parents 8aa1726 + ace7d9e commit 7bd40a7
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,11 @@ export class EdaBubblechartComponent implements AfterViewInit, OnInit {
.style("fill-opacity", 1)
.attr("stroke", "black")
.style("stroke-width", 1)


.on('click', (mouseevent, data) => {
if (this.inject.linkedDashboard) {
const props = this.inject.linkedDashboard;
const value = data.data.name;
const url = window.location.href.substr(0, window.location.href.indexOf('/dashboard')) + `/dashboard/${props.dashboardID}?${props.table}.${props.col}=${value}`
const url = window.location.href.slice(0, window.location.href.indexOf('/dashboard')) + `/dashboard/${props.dashboardID}?${props.table}.${props.col}=${value}`
window.open(url, "_blank");
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,10 @@ export class EdaFunnelComponent implements AfterViewInit, OnInit {
.datum(data2)
.attr('fill', `url(#${this.id}_temperature-gradient)`)
.attr('d', area);

svg.append('path')
.datum(data2)
.attr('fill', `url(#${this.id}_temperature-gradient)`)
.attr('d', areaMirror);

svg.selectAll('.values')
.data(data)
.enter()
Expand Down Expand Up @@ -180,7 +178,15 @@ export class EdaFunnelComponent implements AfterViewInit, OnInit {
font-family: var(--panel-font-family);
font-size: 14px;
`)
.attr("fill", 'var(--panel-font-color)');
.attr("fill", 'var(--panel-font-color)')
.on('click', (mouseevent, data) => {
if (this.inject.linkedDashboard) {
const props = this.inject.linkedDashboard;
const value = data?.label
const url = window.location.href.slice(0, window.location.href.indexOf('/dashboard')) + `/dashboard/${props.dashboardID}?${props.table}.${props.col}=${value}`
window.open(url, "_blank");
}
});

svg.selectAll('.percentages')
.data(data)
Expand All @@ -206,7 +212,6 @@ export class EdaFunnelComponent implements AfterViewInit, OnInit {
.style('stroke-width', 1)
.style('stroke', percentages)
.style('fill', 'none');

}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@ export class EdaScatter implements AfterViewInit {
.attr("cy", d => y(d.y))
.attr("r", d => d.radius + 1)
.attr("fill", d => color(d.category))
.on('click', (e, data) => {
if (this.inject.linkedDashboard) {
const props = this.inject.linkedDashboard;
const value = data.data.name;
const url = window.location.href.slice(0, window.location.href.indexOf('/dashboard')) + `/dashboard/${props.dashboardID}?${props.table}.${props.col}=${value}`
window.open(url, "_blank");
}
})
.on('mouseover', (d, data) => {


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export class EdaSunburstComponent implements AfterViewInit {
.join('path')
.attr('fill', d => color(d.data.name))
.attr('d', arc)


svg
.append('g')
Expand Down Expand Up @@ -201,6 +202,14 @@ export class EdaSunburstComponent implements AfterViewInit {
// per posar-ho a dalt de tot
label.raise();

})
.on('click', (mouseevent, data) => {
if (this.inject.linkedDashboard) {
const props = this.inject.linkedDashboard;
const value = data.data.name;
const url = window.location.href.slice(0, window.location.href.indexOf('/dashboard')) + `/dashboard/${props.dashboardID}?${props.table}.${props.col}=${value}`
window.open(url, "_blank");
}
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class EdaTreeMap implements AfterViewInit {
if (this.inject.linkedDashboard) {
const props = this.inject.linkedDashboard;
const value = data.data.name;
const url = window.location.href.substr(0, window.location.href.indexOf('/dashboard')) + `/dashboard/${props.dashboardID}?${props.table}.${props.col}=${value}`
const url = window.location.href.slice(0, window.location.href.indexOf('/dashboard')) + `/dashboard/${props.dashboardID}?${props.table}.${props.col}=${value}`
window.open(url, "_blank");
}
}).on('mouseover', (d, data) => {
Expand Down

0 comments on commit 7bd40a7

Please sign in to comment.