Skip to content

Commit

Permalink
style changes to assistant
Browse files Browse the repository at this point in the history
  • Loading branch information
birm committed Oct 10, 2023
1 parent c9e6e5f commit cec0dee
Show file tree
Hide file tree
Showing 6 changed files with 913 additions and 905 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ apps/landing/jquery.min.js
apps/landing/jquery.scrollex.min.js
apps/segment/opencv.js
common/bootstrap-tour-standalone/bootstrap-tour-standalone.min.js
apps/viewer/turf.min.js
24 changes: 12 additions & 12 deletions apps/viewer/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ function initCore() {
$UI.annotPopup.open(e.position);
});

$CAMIC.viewer.addHandler('annot-edit-save', function (e) {
$CAMIC.viewer.addHandler('annot-edit-save', function(e) {
if (!e.data) {
return;
}
Expand All @@ -327,16 +327,16 @@ function initCore() {
const dataSize = dataCopy.geometries.features[0].properties.size;
const {points, bound, size} = convertToNormalized(dataPoints, dataSize, $CAMIC.viewer);
dataCopy.geometries.features[0].properties.size = size;
dataCopy.geometries.features[0].geometry.coordinates = [points]
dataCopy.geometries.features[0].bound.coordinates = [bound]
dataCopy.geometries.features[0].geometry.coordinates = [points];
dataCopy.geometries.features[0].bound.coordinates = [bound];
} else {
dataCopy.geometries = ImageFeaturesToVieweportFeatures(
$CAMIC.viewer,
dataCopy.geometries
)
$CAMIC.viewer,
dataCopy.geometries,
);
}
editAnnoCallback(id, slide, dataCopy);
})
});

// create the message bar TODO for reading slide Info TODO
$UI.slideInfos = new CaMessage({
Expand Down Expand Up @@ -845,7 +845,7 @@ async function initUIcomponents() {
// $UI.AssistantViewer.enableBtn.checked = false;
$UI.AssistantViewer.elt.style.display = 'none';
}
})
});

// create UI and set data
$UI.layersViewer = createLayerViewer(
Expand Down Expand Up @@ -968,11 +968,11 @@ async function initUIcomponents() {
// Handle event
$CAMIC.viewer.addHandler('open-add-model', () => {
uploadModel();
})
});

$CAMIC.viewer.addHandler('open-model-info', () => {
showInfo();
})
});

$CAMIC.viewer.addHandler('ml-draw-setting-change', () => {
if (!$CAMIC.viewer.canvasDrawInstance) return;
Expand All @@ -981,7 +981,7 @@ async function initUIcomponents() {
if (canvasDraw._draws_data_.length) {
canvasDraw.__endNewFeature(true);
}
})
});
}

function initModelModals() {
Expand Down Expand Up @@ -1150,7 +1150,7 @@ async function uploadModel() {
const value = element.split('/').pop();
if (value.slice(0, 3) == 'seg') {
const title = element.split('/').pop().split('_')[1].slice(0, -3);
console.log()
console.log();
modelName.push(title);
}
});
Expand Down
10 changes: 5 additions & 5 deletions apps/viewer/uicallbacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -979,8 +979,8 @@ function annoCallback(data) {
}

function editAnnoCallback(id, slide, annotJson) {
// save edit annotation
$CAMIC.store
// save edit annotation
$CAMIC.store
.updateMaskEdit(id, slide, annotJson)
.then((data) => {
// server error
Expand Down Expand Up @@ -2092,10 +2092,10 @@ function savePresetLabel() {
// many brush
const values = features.reduce((p, f) => {
return p.concat(getGrids(
f.geometry.coordinates[0],
f.properties.size,
f.geometry.coordinates[0],
f.properties.size,
));
},[]);
}, []);
const set = new Set();
values.map((i) => i.toString()).forEach((v) => set.add(v));
const points = Array.from(set).map((d) => d.split(','));
Expand Down
Loading

0 comments on commit cec0dee

Please sign in to comment.