kfb-view 2.2.0 → 2.2.3

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.
@@ -48,8 +48,8 @@
48
48
  <option name="RECENT_TEMPLATES">
49
49
  <list>
50
50
  <option value="CSS File" />
51
- <option value="JavaScript File" />
52
51
  <option value="HTML File" />
52
+ <option value="JavaScript File" />
53
53
  </list>
54
54
  </option>
55
55
  </component>
@@ -97,14 +97,14 @@
97
97
  <recent name="$PROJECT_DIR$/src/components/rotation" />
98
98
  </key>
99
99
  <key name="MoveFile.RECENT_KEYS">
100
+ <recent name="$PROJECT_DIR$/src/components/grid" />
100
101
  <recent name="$PROJECT_DIR$" />
101
102
  <recent name="$PROJECT_DIR$/src" />
102
103
  <recent name="$PROJECT_DIR$/example" />
103
104
  <recent name="$PROJECT_DIR$/src/tool" />
104
- <recent name="$PROJECT_DIR$/src/components" />
105
105
  </key>
106
106
  </component>
107
- <component name="RunManager" selected="npm.server:hot">
107
+ <component name="RunManager" selected="npm.build:lib">
108
108
  <configuration name="build:lib" type="js.build_tools.npm" temporary="true" nameIsGenerated="true">
109
109
  <package-json value="$PROJECT_DIR$/package.json" />
110
110
  <command value="run" />
@@ -293,77 +293,16 @@
293
293
  <workItem from="1657366256057" duration="578000" />
294
294
  <workItem from="1657519907711" duration="2848000" />
295
295
  <workItem from="1657527397247" duration="15173000" />
296
- <workItem from="1657587519037" duration="15187000" />
297
- </task>
298
- <task id="LOCAL-00030" summary="优化Curve标注,增加组合">
299
- <created>1631623386433</created>
300
- <option name="number" value="00030" />
301
- <option name="presentableId" value="LOCAL-00030" />
302
- <option name="project" value="LOCAL" />
303
- <updated>1631623386433</updated>
304
- </task>
305
- <task id="LOCAL-00031" summary="组合标注增加ellipse和rect">
306
- <created>1631694555711</created>
307
- <option name="number" value="00031" />
308
- <option name="presentableId" value="LOCAL-00031" />
309
- <option name="project" value="LOCAL" />
310
- <updated>1631694555711</updated>
311
- </task>
312
- <task id="LOCAL-00032" summary="2.0.17">
313
- <created>1631694823499</created>
314
- <option name="number" value="00032" />
315
- <option name="presentableId" value="LOCAL-00032" />
316
- <option name="project" value="LOCAL" />
317
- <updated>1631694823499</updated>
318
- </task>
319
- <task id="LOCAL-00033" summary="标签优化">
320
- <created>1631756759803</created>
321
- <option name="number" value="00033" />
322
- <option name="presentableId" value="LOCAL-00033" />
323
- <option name="project" value="LOCAL" />
324
- <updated>1631756759803</updated>
325
- </task>
326
- <task id="LOCAL-00034" summary="标签优化">
327
- <created>1631757323462</created>
328
- <option name="number" value="00034" />
329
- <option name="presentableId" value="LOCAL-00034" />
330
- <option name="project" value="LOCAL" />
331
- <updated>1631757323462</updated>
332
- </task>
333
- <task id="LOCAL-00035" summary="2.1.1">
334
- <created>1631758578474</created>
335
- <option name="number" value="00035" />
336
- <option name="presentableId" value="LOCAL-00035" />
337
- <option name="project" value="LOCAL" />
338
- <updated>1631758578474</updated>
339
- </task>
340
- <task id="LOCAL-00036" summary="eslint">
341
- <created>1631760254126</created>
342
- <option name="number" value="00036" />
343
- <option name="presentableId" value="LOCAL-00036" />
344
- <option name="project" value="LOCAL" />
345
- <updated>1631760254126</updated>
346
- </task>
347
- <task id="LOCAL-00037" summary="Curve is obsolete. Please use polygon instead">
348
- <created>1631760521355</created>
349
- <option name="number" value="00037" />
350
- <option name="presentableId" value="LOCAL-00037" />
351
- <option name="project" value="LOCAL" />
352
- <updated>1631760521355</updated>
353
- </task>
354
- <task id="LOCAL-00038" summary="优化调整">
355
- <created>1632362091089</created>
356
- <option name="number" value="00038" />
357
- <option name="presentableId" value="LOCAL-00038" />
358
- <option name="project" value="LOCAL" />
359
- <updated>1632362091089</updated>
360
- </task>
361
- <task id="LOCAL-00039" summary="2.1.2">
362
- <created>1632362102053</created>
363
- <option name="number" value="00039" />
364
- <option name="presentableId" value="LOCAL-00039" />
365
- <option name="project" value="LOCAL" />
366
- <updated>1632362102053</updated>
296
+ <workItem from="1657587519037" duration="20593000" />
297
+ <workItem from="1657785384118" duration="336000" />
298
+ <workItem from="1658133724686" duration="5036000" />
299
+ <workItem from="1658365477621" duration="2695000" />
300
+ <workItem from="1658371298489" duration="3932000" />
301
+ <workItem from="1658393509298" duration="2844000" />
302
+ <workItem from="1658398367362" duration="1815000" />
303
+ <workItem from="1658401123366" duration="603000" />
304
+ <workItem from="1658513789094" duration="298000" />
305
+ <workItem from="1658666796644" duration="14031000" />
367
306
  </task>
368
307
  <task id="LOCAL-00040" summary="修复navigator中图片宽高一致时不显示">
369
308
  <created>1632364163945</created>
@@ -638,7 +577,77 @@
638
577
  <option name="project" value="LOCAL" />
639
578
  <updated>1657607397044</updated>
640
579
  </task>
641
- <option name="localTasksCounter" value="79" />
580
+ <task id="LOCAL-00079" summary="2.20.0">
581
+ <created>1657607434015</created>
582
+ <option name="number" value="00079" />
583
+ <option name="presentableId" value="LOCAL-00079" />
584
+ <option name="project" value="LOCAL" />
585
+ <updated>1657607434015</updated>
586
+ </task>
587
+ <task id="LOCAL-00080" summary="2.2.0">
588
+ <created>1657607449348</created>
589
+ <option name="number" value="00080" />
590
+ <option name="presentableId" value="LOCAL-00080" />
591
+ <option name="project" value="LOCAL" />
592
+ <updated>1657607449348</updated>
593
+ </task>
594
+ <task id="LOCAL-00081" summary="加载速度优化">
595
+ <created>1657612318446</created>
596
+ <option name="number" value="00081" />
597
+ <option name="presentableId" value="LOCAL-00081" />
598
+ <option name="project" value="LOCAL" />
599
+ <updated>1657612318447</updated>
600
+ </task>
601
+ <task id="LOCAL-00082" summary="2.2.1">
602
+ <created>1657612343466</created>
603
+ <option name="number" value="00082" />
604
+ <option name="presentableId" value="LOCAL-00082" />
605
+ <option name="project" value="LOCAL" />
606
+ <updated>1657612343466</updated>
607
+ </task>
608
+ <task id="LOCAL-00083" summary="index.js">
609
+ <created>1657785699795</created>
610
+ <option name="number" value="00083" />
611
+ <option name="presentableId" value="LOCAL-00083" />
612
+ <option name="project" value="LOCAL" />
613
+ <updated>1657785699797</updated>
614
+ </task>
615
+ <task id="LOCAL-00084" summary="导航轨迹显示">
616
+ <created>1658394875542</created>
617
+ <option name="number" value="00084" />
618
+ <option name="presentableId" value="LOCAL-00084" />
619
+ <option name="project" value="LOCAL" />
620
+ <updated>1658394875543</updated>
621
+ </task>
622
+ <task id="LOCAL-00085" summary="刻度线显示">
623
+ <created>1658398987159</created>
624
+ <option name="number" value="00085" />
625
+ <option name="presentableId" value="LOCAL-00085" />
626
+ <option name="project" value="LOCAL" />
627
+ <updated>1658398987163</updated>
628
+ </task>
629
+ <task id="LOCAL-00086" summary="2.2.2">
630
+ <created>1658399404095</created>
631
+ <option name="number" value="00086" />
632
+ <option name="presentableId" value="LOCAL-00086" />
633
+ <option name="project" value="LOCAL" />
634
+ <updated>1658399404095</updated>
635
+ </task>
636
+ <task id="LOCAL-00087" summary="增加网格线和标尺">
637
+ <created>1658710072174</created>
638
+ <option name="number" value="00087" />
639
+ <option name="presentableId" value="LOCAL-00087" />
640
+ <option name="project" value="LOCAL" />
641
+ <updated>1658710072175</updated>
642
+ </task>
643
+ <task id="LOCAL-00088" summary="标注信息优化显示">
644
+ <created>1658713081785</created>
645
+ <option name="number" value="00088" />
646
+ <option name="presentableId" value="LOCAL-00088" />
647
+ <option name="project" value="LOCAL" />
648
+ <updated>1658713081785</updated>
649
+ </task>
650
+ <option name="localTasksCounter" value="89" />
642
651
  <servers />
643
652
  </component>
644
653
  <component name="TypeScriptGeneratedFilesManager">
@@ -680,16 +689,6 @@
680
689
  <component name="VcsManagerConfiguration">
681
690
  <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
682
691
  <option name="LOCAL_CHANGES_DETAILS_PREVIEW_SHOWN" value="false" />
683
- <MESSAGE value="2.1.12 导出OpenSeadragon" />
684
- <MESSAGE value="重写绘制逻辑" />
685
- <MESSAGE value="package.json" />
686
- <MESSAGE value="组合框异常" />
687
- <MESSAGE value="2.1.14" />
688
- <MESSAGE value="闭合区域" />
689
- <MESSAGE value="2.1.15" />
690
- <MESSAGE value="闭合曲线" />
691
- <MESSAGE value="2.1.16" />
692
- <MESSAGE value="优化加载速度" />
693
692
  <MESSAGE value="2.1.17" />
694
693
  <MESSAGE value="2.1.18" />
695
694
  <MESSAGE value="增加曲线开始点显示" />
@@ -705,7 +704,17 @@
705
704
  <MESSAGE value="优化选中点" />
706
705
  <MESSAGE value="优化标注图形显示,一次最多绘制5000个点,超过的标注延迟加载" />
707
706
  <MESSAGE value="键盘事件更新,delete可删除曲线标注点,双击可添加曲线标注点" />
708
- <option name="LAST_COMMIT_MESSAGE" value="键盘事件更新,delete可删除曲线标注点,双击可添加曲线标注点" />
707
+ <MESSAGE value="2.20.0" />
708
+ <MESSAGE value="2.2.0" />
709
+ <MESSAGE value="加载速度优化" />
710
+ <MESSAGE value="2.2.1" />
711
+ <MESSAGE value="index.js" />
712
+ <MESSAGE value="导航轨迹显示" />
713
+ <MESSAGE value="刻度线显示" />
714
+ <MESSAGE value="2.2.2" />
715
+ <MESSAGE value="增加网格线和标尺" />
716
+ <MESSAGE value="标注信息优化显示" />
717
+ <option name="LAST_COMMIT_MESSAGE" value="标注信息优化显示" />
709
718
  <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="true" />
710
719
  </component>
711
720
  <component name="XSLT-Support.FileAssociations.UIState">
@@ -65,9 +65,10 @@ module.exports = function() {
65
65
  context: ['/api', '/image.php', '/process.php'],
66
66
  // target: 'http://gastric.label.hzztai.com/',
67
67
  // target: 'http://192.168.1.91:7007',
68
- target: 'http://192.168.1.91',
68
+ // target: 'http://192.168.1.91',
69
69
  // target: 'https://tct.hzztai.com',
70
70
  // target: 'https://pis-ningbo.hzztai.com',
71
+ target: 'https://pis-test.hzztai.com',
71
72
  secure: false,
72
73
  changeOrigin: true,
73
74
  },
package/example/index.js CHANGED
@@ -2,7 +2,7 @@ import {KfbView, hslToRgb, rgbToHsl, cacheGammaTable} from '../src';
2
2
  import axios from 'axios';
3
3
  import {EVENT_DB_CLICK_LABEL} from '../src/const/event';
4
4
 
5
- const fileName = '/upload/large_file/last/2022/04/26/d31a31bf1ae5b73fca63f72e2affc879/胃镜1.kfb';
5
+ const fileName = '/upload/large_file/last/2022/06/22/3625ce6de8197c7315ce9e05b4ef233b/IHC.kfb';
6
6
 
7
7
  const instance = axios.create({
8
8
  baseURL: '/api',
@@ -40,15 +40,22 @@ instance.get(`/slide/info?file=${fileName}`).then(({data}) => {
40
40
  ROI: false,
41
41
  },
42
42
  graduation: {
43
- right: 30,
43
+ left: 30,
44
+ bottom: 10,
44
45
  },
45
46
  navigator: {
46
47
  disabled: false,
47
- height: 200,
48
48
  style: 'right: 0;top: 0',
49
49
  thumbnail: `/api/slide/getImage?file=${fileName}&type=thumbnail`,
50
- vestige: true,
51
- vestigeZoom: .1,
50
+ scale: data.scanScale,
51
+ },
52
+ pxConversion: {
53
+ unit: 'um',
54
+ imageCapRes: data.imageCapRes,
55
+ },
56
+ grid: {
57
+ show: true,
58
+ ruler: true,
52
59
  },
53
60
  openSeadragonOptions: {
54
61
  maxZoomLevel: data.scanScale * 10,
@@ -178,10 +185,20 @@ instance.get(`/slide/info?file=${fileName}`).then(({data}) => {
178
185
  size.y,
179
186
  );
180
187
  },
188
+ measure: {
189
+ handler(content, label) {
190
+ return [...content, '标注人: xxx'];
191
+ },
192
+ },
181
193
  });
182
194
  /* kv.board.startDraw({
183
195
  tool: KfbView.marks.POLYGON,
184
196
  });*/
197
+ kv.viewer.addHandler('zoom', (res) => {
198
+ const zoom = kv.viewer.viewport.viewportToImageZoom(res.zoom) *
199
+ kv.$options.scale;
200
+ console.log(zoom.toFixed(2) / 1);
201
+ });
185
202
  console.log(kv);
186
203
  let list = [];
187
204
  document.querySelector('#a').onchange = debounce(changeRange, 500);
@@ -213,7 +230,7 @@ instance.get(`/slide/info?file=${fileName}`).then(({data}) => {
213
230
  lineWidth: 10,
214
231
  isROI: false,
215
232
  once: true,
216
- measure: false,
233
+ measure: true,
217
234
  resize: false,
218
235
  move: false,
219
236
  fillStyle: '#ff00ff8d',
@@ -319,22 +336,29 @@ instance.get(`/slide/info?file=${fileName}`).then(({data}) => {
319
336
  });*/
320
337
  setTimeout(() => {
321
338
  // kv.destroy();
339
+ kv.navigator.toggleNavigator();
340
+ setTimeout(() => {
341
+ // kv.destroy();
342
+ kv.navigator.toggleNavigator();
343
+ }, 6000);
322
344
  }, 6000);
323
- initLabels();
345
+
346
+ // initLabels();
324
347
 
325
348
  function initLabels() {
326
349
  const labels = [];
327
- for (let i = 0; i < 1000; i++) {
350
+ const colors = ['#027AFF', '#f56c6c'];
351
+ for (let i = 0; i < 50000; i++) {
328
352
  const point = {
329
- x: data.width / 2 + Math.random() * 10000,
330
- y: data.height / 2 + Math.random() * 10000,
353
+ x: Math.random() * data.width,
354
+ y: Math.random() * data.height,
331
355
  };
332
356
  const label = {
333
357
  // fillStyle: 'rgba(2, 122, 255, 1)',
334
358
  lineWidth: 6,
335
359
  points: [point, point],
336
360
  scale: 0.1,
337
- strokeStyle: '#027AFF',
361
+ strokeStyle: Math.random() > .5 ? colors[0] : colors[1],
338
362
  tool: 'Dot',
339
363
  move: false,
340
364
  };