Skip to content

Commit d65537a

Browse files
author
Jason Wang
committed
[Fix] Frontend rendering issue.
1 parent 3f463e3 commit d65537a

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

web/apps/labelstudio/src/app/App.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const queryClient = new QueryClient({
3737
});
3838

3939
const browserHistory = createBrowserHistory({
40-
basename: baseURL.pathname || "/",
40+
basename: "/label-studio",
4141
// callback is an async way to confirm or decline going to another page in the context of routing. It accepts `true` or `false`
4242
getUserConfirmation: (message, callback) => {
4343
// `history.block` doesn't block events, so in the case of listeners,

web/libs/datamanager/src/components/CellViews/ImageCell.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const ImageCell = (column) => {
2020
if (!imgSrc) return null;
2121

2222
const getImageSrc = (src) => {
23+
const data = ['.svs', '.csp', '.sdpc', 'tiff', '.ndpi', '.scn', '.mrxs', '.bif', '.svslide'];
2324
if (data.some(key => src?.includes(key))) {
2425
return `${src}&level=6&col=0&row=0`;
2526
}

web/libs/editor/src/components/ImageView/Dragron.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@ export const Dragon = observer(
2929

3030
const tileSize = imageElement.getAttribute("TileSize");
3131
const width = sizeElement.getAttribute("Width");
32-
const height = sizeElement.getAttribute('Height')
32+
const height = sizeElement.getAttribute('Height');
33+
console.log("width", width, "height", height, "tileSize", tileSize);
3334
viewer = drawSeaDragon(imageEntity.src, width -0,height-0,tileSize-0);
3435
})
3536

3637
}
3738

39+
console.log("imageEntity", imageEntity);
40+
3841
let viewer = null;
3942
if (imageEntity.src) {
4043
getImageData(imageEntity.src);

web/libs/editor/src/components/ImageView/setOpenSeaDragon.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import { ImageList } from "../../examples/image_list";
2+
13
let viewer: any = null;
24

35
export const drawSeaDragon = (src: any, width: any, height: any, tileSize: any)=> {
4-
const OpenSeaDragon = (window as any)?.OpenSeaDragon;
6+
const OpenSeaDragon = (window as any)?.OpenSeadragon;
57
const container = document.querySelector('#img-mem-view');
68
if (!src || !height || !width || !tileSize) {
79
return;
@@ -23,7 +25,7 @@ export const drawSeaDragon = (src: any, width: any, height: any, tileSize: any)=
2325
}
2426

2527
if (container && !viewer && OpenSeaDragon) {
26-
viewer = new OpenSeadragon({
28+
viewer = new OpenSeaDragon({
2729
id: "img-mem-view",
2830
tileSources: [
2931
{
@@ -40,7 +42,9 @@ export const drawSeaDragon = (src: any, width: any, height: any, tileSize: any)=
4042
prefixUrl: "/static/images/",
4143
showNavigator: true,
4244
showRotationControl: true,
43-
animationTime: 0.5,
45+
animationTime: 2,
46+
imageLoaderLimit: 6,
47+
springStiffness: 3,
4448
blendTime: 0.1,
4549
constrainDuringPan: true,
4650
maxZoomPixelRatio: 2,

web/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ module.exports = composePlugins(
9494
config.output = {
9595
...config.output,
9696
uniqueName: "labelstudio",
97-
publicPath: isDevelopment && FRONTEND_HOSTNAME ? `${FRONTEND_HOSTNAME}/react-app/` : "auto",
97+
publicPath: isDevelopment && FRONTEND_HOSTNAME ? `${FRONTEND_HOSTNAME}/react-app/` : "/label-studio",
9898
scriptType: "text/javascript",
9999
};
100100

0 commit comments

Comments
 (0)