kfb-view 2.2.2 → 2.2.5

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.
package/src/view.js CHANGED
@@ -19,6 +19,7 @@ export default class KfbView extends EventEmitter {
19
19
  * @constructs
20
20
  * @param {Object} config 配置参数
21
21
  * @param {HTMLElement|string} config.el 图像容器
22
+ * @param {number=} config.scale 图像的最大倍率
22
23
  * @param {Object} config.openSeadragonOptions openSeadragon参数
23
24
  * @param {function=} config.tileDrawing openSeadragon绘制tile-drawing事件回调
24
25
  * @param {Object} [config.navigator = {}] navigator参数
@@ -57,9 +58,17 @@ export default class KfbView extends EventEmitter {
57
58
  * @param {boolean=} config.board.ROI 是否开启ROI,开启后只能在标注类型是ROI的区域内绘制图形
58
59
  * @param {Object} config.graduation 刻度参数
59
60
  * @param {boolean=} config.graduation.disabled 是否禁用刻度
61
+ * @param {boolean=} config.graduation.show 是否显刻度
60
62
  * @param {boolean=} config.graduation.custom 是否自定义刻度,抛出graduation-change事件
61
63
  * @param {array=} config.graduation.scales 倍率数组
62
64
  * @param {array=} config.graduation.microns 刻度长度数组,在对应倍率范围内显示的刻度长度
65
+ * @param {boolean=} config.grid.disabled 是否禁用网格线
66
+ * @param {boolean=} config.grid.show 是否显示网格线
67
+ * @param {boolean=} config.grid.ruler 是否启用标尺
68
+ * @param {function=} config.measure.handler 标注信息的回调处理
69
+ * @param {boolean=} config.measure.color 标注注释颜色
70
+ * @param {boolean=} config.measure.backgroundColor 标注注释背景色
71
+ * @param {boolean=} config.measure.fontSize 标注注释文字大小
63
72
  * @param {array} config.labelList 标注列表
64
73
  */
65
74
  constructor(config) {
@@ -236,6 +245,7 @@ function initNavigator(kv) {
236
245
  containerHeight: config.height,
237
246
  containerWidth: config.width,
238
247
  element: navigator,
248
+ scale: config.scale,
239
249
  ...config.navigator,
240
250
  });
241
251
  }
@@ -261,7 +271,16 @@ function initComponentsOptions(kv, type) {
261
271
  cache: kv.cache,
262
272
  canvas: createCanvas(kv),
263
273
  options: {
264
- ...config[type], ...pxConversion, thumb: config.thumb ? {
274
+ scale: config.scale,
275
+ measure: {
276
+ backgroundColor: 'rgba(0,0,0,.5)',
277
+ color: '#FFF',
278
+ fontSize: 14,
279
+ ...(config.measure || {}),
280
+ },
281
+ ...config[type],
282
+ ...pxConversion,
283
+ thumb: config.thumb ? {
265
284
  radius: 5,
266
285
  activeRadius: 7,
267
286
  activeBgColor: '#01d0b0',