Skip to content

Commit

Permalink
Merge pull request #137 from philips-emr/partogram-axisCustom-fix
Browse files Browse the repository at this point in the history
Ajuste tooltip/contração Partograma
  • Loading branch information
rubiabornhofen authored Sep 21, 2023
2 parents ec80935 + bea041f commit 306fa0c
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 26 deletions.
36 changes: 33 additions & 3 deletions dist/vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* A dynamic, browser-based visualization library.
*
* @version 4.15.4
* @date 2023-09-13
* @date 2023-09-21
*
* @license
* Copyright (C) 2011-2016 Almende B.V, http://almende.com
Expand Down Expand Up @@ -7883,6 +7883,33 @@ return /******/ (function(modules) { // webpackBootstrap
points.push(partogramPoint);
}
break;
case 'partogram-contraction':
if (props.partogramContraction && !isNaN(y) && !isNaN(x)) {
var colorFill = '#3262DB';
if (props.partogramContraction == 'EMPTY_CIRCLE') {
colorFill = '#FFFFFF';
}

var sizeChart = 0.65 * groupTemplate.size;
var _circle = exports.getSVGElement('circle', JSONcontainer, svgContainer);
_circle.setAttributeNS(null, 'cx', x);
_circle.setAttributeNS(null, 'cy', y);
_circle.setAttributeNS(null, 'r', sizeChart);
_circle.setAttributeNS(null, 'stroke', '#3262DB');
_circle.setAttributeNS(null, 'fill', colorFill);
_circle.setAttributeNS(null, 'stroke-width', 1);
points.push(_circle);

if (props.partogramContraction == 'SEMI_CIRCLE') {
var path = exports.getSVGElement('path', JSONcontainer, svgContainer);
path.setAttributeNS(null, 'd', 'M' + (x - sizeChart) + ',' + y + ' a' + sizeChart + ',' + sizeChart + ' 0 0,1 ' + sizeChart * 2 + ',0');
path.setAttributeNS(null, 'stroke', '#3262DB');
path.setAttributeNS(null, 'fill', '#FFFFFF');
path.setAttributeNS(null, 'stroke-width', 1);
points.push(path);
}
}
break;
}
//handle label

Expand Down Expand Up @@ -27759,6 +27786,7 @@ return /******/ (function(modules) { // webpackBootstrap
extended.alertMax = _item.alertMax;
extended.alertMed = _item.alertMed;
extended.alertColor = _item.alertColor;
extended.dateRecord = _item.dateRecord;

var index = groupsContent[_groupId].length - groupCounts[_groupId]--;
groupsContent[_groupId][index] = extended;
Expand Down Expand Up @@ -28795,7 +28823,8 @@ return /******/ (function(modules) { // webpackBootstrap
screen_yAvg = d.screen_yAvg,
screen_yMax = d.screen_yMax,
calculateAllPoints = d.calculateAllPoints,
partogramPosition = d.partogramPosition;
partogramPosition = d.partogramPosition,
partogramContraction = d.partogramContraction;

var props = {
maxValue: maxValue,
Expand All @@ -28813,7 +28842,8 @@ return /******/ (function(modules) { // webpackBootstrap
screen_yAvg: screen_yAvg,
screen_yMax: screen_yMax,
calculateAllPoints: calculateAllPoints,
partogramPosition: partogramPosition
partogramPosition: partogramPosition,
partogramContraction: partogramContraction
};
if (d.referenceLine) continue;
if (!callback) {
Expand Down
2 changes: 1 addition & 1 deletion dist/vis.map

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions dist/vis.min.js

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions lib/DOMutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,33 @@ exports.drawPoint = function(x, y, groupTemplate, JSONcontainer, svgContainer, l
points.push(partogramPoint);
}
break;
case 'partogram-contraction':
if (props.partogramContraction && !isNaN(y) && !isNaN(x)) {
let colorFill = '#3262DB';
if (props.partogramContraction == 'EMPTY_CIRCLE') {
colorFill = '#FFFFFF';
}

const sizeChart = 0.65 * groupTemplate.size;
const circle = exports.getSVGElement('circle', JSONcontainer, svgContainer);
circle.setAttributeNS(null, 'cx', x);
circle.setAttributeNS(null, 'cy', y);
circle.setAttributeNS(null, 'r', sizeChart);
circle.setAttributeNS(null, 'stroke', '#3262DB');
circle.setAttributeNS(null, 'fill', colorFill);
circle.setAttributeNS(null, 'stroke-width', 1);
points.push(circle);

if (props.partogramContraction == 'SEMI_CIRCLE') {
const path = exports.getSVGElement('path', JSONcontainer, svgContainer);
path.setAttributeNS(null, 'd', `M${x - sizeChart},${y} a${sizeChart},${sizeChart} 0 0,1 ${sizeChart * 2},0`);
path.setAttributeNS(null, 'stroke', '#3262DB');
path.setAttributeNS(null, 'fill', '#FFFFFF');
path.setAttributeNS(null, 'stroke-width', 1);
points.push(path);
}
}
break;
}
//handle label

Expand Down
1 change: 1 addition & 0 deletions lib/timeline/component/LineGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ LineGraph.prototype._generateGroupContents = function (itemsData) {
extended.alertMax = item.alertMax;
extended.alertMed = item.alertMed;
extended.alertColor = item.alertColor;
extended.dateRecord = item.dateRecord;

const index = groupsContent[groupId].length - groupCounts[groupId]--;
groupsContent[groupId][index] = extended;
Expand Down
3 changes: 2 additions & 1 deletion lib/timeline/component/graph2d_types/points.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Points.draw = function (dataset, group, framework, offset) {
for (var i = 0; i < dataset.length; i++) {
let point;
const d = dataset[i];
const { maxValue, avgValue, minValue, alertMin, alertMax, alertMed, alertColor, screen_yMin, screen_yAvg, screen_yMax, calculateAllPoints, partogramPosition } = d;
const { maxValue, avgValue, minValue, alertMin, alertMax, alertMed, alertColor, screen_yMin, screen_yAvg, screen_yMax, calculateAllPoints, partogramPosition, partogramContraction } = d;
const props = {
maxValue,
avgValue,
Expand All @@ -39,6 +39,7 @@ Points.draw = function (dataset, group, framework, offset) {
screen_yMax,
calculateAllPoints,
partogramPosition,
partogramContraction,
}
if(d.referenceLine) continue;
if (!callback) {
Expand Down

0 comments on commit 306fa0c

Please sign in to comment.