WIP Measurements service.

This commit is contained in:
James A. Petts committed 2020-06-25 12:15:33 +02:00
1 parent 67508f6667
commit 7b7b63de93
13 files changed
+453 -151

No files matched your search

@@ -40,6 +40,10 @@ const MEASUREMENT_SCHEMA_KEYS = [
'type',
'unit',
'area', // TODO: Add concept names instead (descriptor)
'length',
'shortestDiameter',
'longestDiameter',
'text', // NOTE: There is nothing like this in SR.
'points',
'source',
];
@@ -53,6 +57,7 @@ const EVENTS = {
const VALUE_TYPES = {
POLYLINE: 'value_type::polyline',
POINT: 'value_type::point',
BIDIRECTIONAL: 'value_type::shortAxisLongAxis', // TODO -> Discuss with Danny. => just using SCOORD values isn't enough here.
ELLIPSE: 'value_type::ellipse',
MULTIPOINT: 'value_type::multipoint',
CIRCLE: 'value_type::circle',
@@ -14,7 +14,7 @@ const MeasurementTable = ({ data, title, amount, onClick, onEdit }) => {
</div>
<div className="overflow-y-auto overflow-x-hidden ohif-scrollbar max-h-112">
{!!data.length &&
data.map((measurementItem) => {
data.map(measurementItem => {
const { id, label, displayText, isActive } = measurementItem;
return (
<div
@@ -45,9 +45,11 @@ const MeasurementTable = ({ data, title, amount, onClick, onEdit }) => {
<span className="text-base text-primary-light mb-1">
{label}
</span>
<span className="pl-2 border-l border-primary-light text-base text-white">
{displayText}
</span>
{displayText.map(line => (
<span className="pl-2 border-l border-primary-light text-base text-white">
{line}
</span>
))}
<Icon
className={classnames(
'text-white w-4 absolute cursor-pointer transition duration-300',
@@ -61,7 +63,7 @@ const MeasurementTable = ({ data, title, amount, onClick, onEdit }) => {
right: 4,
transform: isActive ? '' : 'translateX(100%)',
}}
onClick={(e) => {
onClick={e => {
// stopPropagation needed to avoid disable the current active item
e.stopPropagation();
onEdit(id);
@@ -108,7 +110,7 @@ MeasurementTable.propTypes = {
PropTypes.shape({
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
label: PropTypes.string,
displayText: PropTypes.string,
displayText: PropTypes.arrayOf(PropTypes.string),
isActive: PropTypes.bool,
})
),