kfb-view 3.3.0 → 3.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ //! Built on 2024-04-01
2
+
3
+ //! Git commit: v4.1.1-1-f90d9814
4
+
5
+ //! License: http://openseadragon.github.io/license/
6
+
7
+ //! http://openseadragon.github.io
8
+
9
+ //! openseadragon 4.1.1
package/package.json CHANGED
@@ -1,20 +1,23 @@
1
1
  {
2
2
  "name": "kfb-view",
3
3
  "description": "一个在线kfb的阅片软件",
4
- "version": "3.3.0",
4
+ "version": "3.3.2",
5
5
  "author": "qifeng.fan <qifeng.fan@hzztai.com>",
6
6
  "license": "MIT",
7
- "main": "lib/kfb-view.js",
7
+ "main": "lib/kfb-view.cjs.js",
8
+ "module": "lib/kfb-view.es.js",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./lib/kfb-view.es.js",
12
+ "require": "./lib/kfb-view.cjs.js"
13
+ }
14
+ },
8
15
  "scripts": {
9
- "build:dev": "npm run clean:dist && npm run webpack -- --mode development --config config/webpack.dev.conf.js --progress --profile",
10
- "build:prod": "npm run clean:dist && npm run webpack -- --mode production --config config/webpack.prod.conf.js --progress --profile --bail",
11
16
  "build:lib": "npm run clean:lib && npm run webpack -- --mode production --config config/webpack.lib.conf.js --progress --profile --bail",
12
- "build": "npm run build:prod",
13
- "clean:dist": "npm run rimraf -- dist",
17
+ "build": "npm run build:lib",
14
18
  "clean:lib": "npm run rimraf -- lib",
15
19
  "rimraf": "rimraf",
16
- "server:hot": "npm run webpack-dev-server -- --mode development --config config/webpack.dev.conf.js --hot --progress --profile --watch",
17
- "server:dev": "npm run webpack-dev-server -- --mode development --config config/webpack.dev.conf.js --progress --profile --wascreenshottch",
20
+ "server:dev": "npm run webpack-dev-server -- --mode development --config config/webpack.dev.conf.js --hot --progress --profile",
18
21
  "server": "npm run server:dev",
19
22
  "start": "npm run build",
20
23
  "webpack-dev-server": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js",
@@ -25,7 +28,6 @@
25
28
  "mitt": "^3.0.1"
26
29
  },
27
30
  "devDependencies": {
28
- "axios": "^1.6.5",
29
31
  "@babel/core": "^7.0.0",
30
32
  "@babel/plugin-proposal-class-properties": "^7.0.0",
31
33
  "@babel/plugin-proposal-decorators": "^7.0.0",
@@ -43,37 +45,31 @@
43
45
  "@babel/plugin-syntax-dynamic-import": "^7.0.0",
44
46
  "@babel/plugin-syntax-import-meta": "^7.0.0",
45
47
  "@babel/preset-env": "^7.0.0",
46
- "@purtuga/esm-webpack-plugin": "^1.5.0",
47
48
  "autoprefixer": "^8.6.4",
48
- "babel-eslint": "^9.0.0",
49
- "babel-loader": "^8.0.0",
50
- "compression-webpack-plugin": "^1.1.11",
49
+ "axios": "^1.6.5",
50
+ "babel-eslint": "^10.1.0",
51
+ "babel-loader": "^10.0.0",
51
52
  "copy-webpack-plugin": "^4.5.2",
52
53
  "core-js": "^3.6.5",
53
- "css-loader": "^0.28.11",
54
+ "css-loader": "^7.1.2",
54
55
  "eslint": "^5.0.1",
55
56
  "eslint-config-google": "^0.9.1",
56
57
  "eslint-friendly-formatter": "^4.0.1",
57
- "eslint-loader": "^2.0.0",
58
58
  "eslint-plugin-html": "^4.0.5",
59
- "file-loader": "^1.1.11",
60
- "html-loader": "^0.5.5",
61
- "html-webpack-plugin": "^3.2.0",
62
- "mini-css-extract-plugin": "^0.4.1",
63
- "node-sass": "^4.9.0",
64
- "postcss-import": "^11.1.0",
65
- "postcss-loader": "^2.1.5",
59
+ "html-loader": "^5.1.0",
60
+ "html-webpack-plugin": "^5.6.3",
61
+ "mini-css-extract-plugin": "^2.9.2",
62
+ "sass": "^1.89.1",
63
+ "postcss-import": "^16.1.1",
64
+ "postcss-loader": "^8.1.1",
66
65
  "rimraf": "^2.6.2",
67
- "sass-loader": "^7.0.3",
68
- "script-ext-html-webpack-plugin": "^2.0.1",
69
- "style-loader": "^0.21.0",
66
+ "sass-loader": "^16.0.5",
67
+ "style-loader": "^4.0.0",
70
68
  "terser-webpack-plugin": "^4.2.2",
71
- "url-loader": "^1.0.1",
72
- "webpack": "^4.14.0",
73
- "webpack-cli": "^3.0.8",
74
- "webpack-dev-server": "^3.1.4",
75
- "webpack-merge": "^4.1.3",
76
- "worker-loader": "^2.0.0"
69
+ "webpack": "^5.100.1",
70
+ "webpack-cli": "^6.0.1",
71
+ "webpack-dev-server": "^5.2.2",
72
+ "webpack-merge": "^6.0.1"
77
73
  },
78
74
  "engines": {
79
75
  "node": ">= 6.11.5",
@@ -271,7 +271,7 @@ export class ViewerCommon {
271
271
  `${this.translate('long_axis')}:${this.getUnitNumber(a)}`,
272
272
  `${this.translate('short_axis')}:${this.getUnitNumber(b)}`,
273
273
  `${this.translate('perimeter')}:${this.getUnitNumber(4 * (a - b) + 2 * Math.PI * b)}`,
274
- `${this.translate('area')}:${this.getUnitNumber(Math.PI * a * b / this.options.binary)}²`],
274
+ `${this.translate('area')}:${this.getUnitNumber(Math.PI * a * b, 2)}²`],
275
275
  };
276
276
  }
277
277
  break;
@@ -279,7 +279,7 @@ export class ViewerCommon {
279
279
  const w = Math.abs(endPoint.x - startPoint.x) * this.options.imageCapRes;
280
280
  const h = Math.abs(endPoint.y - startPoint.y) * this.options.imageCapRes;
281
281
  const pt = (w + h) * 2;
282
- const ac = w * h / this.options.binary;
282
+ const ac = w * h;
283
283
  const rightTop = getRectPoint(startPoint, endPoint)[2];
284
284
  const p = this.imageToViewerElementCoordinates(rightTop.x,
285
285
  rightTop.y);
@@ -291,7 +291,7 @@ export class ViewerCommon {
291
291
  `${this.translate('length')}:${this.getUnitNumber(w)}`,
292
292
  `${this.translate('width')}:${this.getUnitNumber(h)}`,
293
293
  `${this.translate('perimeter')}:${this.getUnitNumber(pt)}`,
294
- `${this.translate('area')}:${this.getUnitNumber(ac)}²`],
294
+ `${this.translate('area')}:${this.getUnitNumber(ac, 2)}²`],
295
295
  };
296
296
  }
297
297
  break;
@@ -312,7 +312,7 @@ export class ViewerCommon {
312
312
  texts: [
313
313
  `${this.translate('perimeter')}:${this.getUnitNumber((pt * this.options.imageCapRes).toFixed(2))}`,
314
314
  `${this.translate('area')}:${this.getUnitNumber(
315
- calculatePolygonArea(points, this.options.imageCapRes) / this.options.binary)}²`],
315
+ calculatePolygonArea(points, this.options.imageCapRes), 2)}²`],
316
316
  };
317
317
  }
318
318
  break;
@@ -335,8 +335,9 @@ export class ViewerCommon {
335
335
  };
336
336
  }
337
337
 
338
- getUnitNumber(number, index) {
339
- return getUnitNumber(number, this.options.units, this.options.binary, index);
338
+ getUnitNumber(number, index = 1) {
339
+ const binary = Math.pow(this.options.binary, index);
340
+ return getUnitNumber(number, this.options.units, binary);
340
341
  }
341
342
 
342
343
  /**
@@ -1,4 +1,4 @@
1
- import {DOT, FLAG, STAR} from '../const/mark';
1
+ import {DOT, FLAG, IMAGE, STAR} from '../const/mark';
2
2
 
3
3
  export class LabelModel {
4
4
  constructor(data = {}) {
@@ -28,9 +28,10 @@ export class LabelModel {
28
28
  this.custom = data.custom ?? false; // 是否是自定义的标注
29
29
  this.select = data.select ?? false; // 是否是选中状态
30
30
  this.show = data.show ?? true; // 是否显示
31
+ this.subType = data.subType; // 自定义类型
31
32
  this.__other__ = data.__other__ || {}; // 其他信息
32
33
  this.__data__ = data.__data__ ?? data; // 记录原始数据
33
- if (this.src) {
34
+ if (this.src && this.tool === IMAGE) {
34
35
  this.img = new Image();
35
36
  this.img.src = this.src;
36
37
  this.imgLoadSuccess = false;