Skip to content
This repository was archived by the owner on Jan 11, 2020. It is now read-only.
Open
Changes from all commits
Commits
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
19 changes: 12 additions & 7 deletions src/app/graph/graph.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ export class GraphService {
})
.remove();

const getY = (d) => {

}

const getHeight = (d) => {

}

const update = () => {
// console.log('update');
barCIs
Expand All @@ -203,11 +211,11 @@ export class GraphService {
.attr('x', (d) => this.scales.x(d.data[0][this.settings.props.x]))
.attr('width', this.scales.x.bandwidth())
.attr('height', (d) => {
return displayCI ?
return (displayCI && d.data[0][this.settings.props.y] >= 0.1) ?
(this.height - Math.max(0, this.scales.y(d.data[0][this.settings.props.ciH] - d.data[0][this.settings.props.ciL]))) : 0;
})
.attr('y', (d) => {
return displayCI ?
return (displayCI && d.data[0][this.settings.props.y] >= 0.1) ?
(Math.max(0, this.scales.y(d.data[0][this.settings.props.ciH]))) : this.scales.y(d.data[0][this.settings.props.y]);
});
};
Expand All @@ -231,12 +239,12 @@ export class GraphService {
.ease(this.settings.transition.ease)
.duration(this.settings.transition.duration)
.attr('height', (d) => {
return displayCI ?
return (displayCI && d.data[0][this.settings.props.y] >= 0.1) ?
(this.height - Math.max(0, this.scales.y(d.data[0][this.settings.props.ciH] - d.data[0][this.settings.props.ciL]))) : 0;
})
.attr('y', (d) => {
// return Math.max(0, this.scales.y(d.data[0][this.settings.props.ciH]));
return displayCI ?
return (displayCI && d.data[0][this.settings.props.y] >= 0.1) ?
(Math.max(0, this.scales.y(d.data[0][this.settings.props.ciH]))) : this.scales.y(d.data[0][this.settings.props.y]);
});
}
Expand All @@ -259,7 +267,6 @@ export class GraphService {
.attr('height', 0)
.attr('y', this.height)
.remove();
// .on('end', this.renderBarCI());

const update = () => {
// console.log('bars update()');
Expand All @@ -272,7 +279,6 @@ export class GraphService {
.attr('y', (d) => this.scales.y(this.getBarDisplayVal(d.data[0][this.settings.props.y], this.scales.y)))
.attr('x', (d) => this.scales.x(d.data[0][this.settings.props.x]))
.attr('width', this.scales.x.bandwidth());
// .on('end', this.renderBarCI());
};

if (this.type === 'bar') {
Expand All @@ -293,7 +299,6 @@ export class GraphService {
.duration(this.settings.transition.duration)
.attr('height', (d) => Math.max(0, this.height - this.scales.y(d.data[0][this.settings.props.y])))
.attr('y', (d) => this.scales.y(d.data[0][this.settings.props.y]));
// .on('end', this.renderBarCI());
}
this.renderBarCI();
return this;
Expand Down