eli-video-interview 1.2.42-alpha.34 → 1.2.42-alpha.35

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.
@@ -179,7 +179,6 @@ var draw = function (layout, dimensions, pathRef, ctx) {
179
179
  ctx.font = '16px sans-serif';
180
180
  ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
181
181
  dimensions.forEach(function (v, i) {
182
- var _a;
183
182
  var config = getLevel(v.score);
184
183
  // 绘制圆角矩形
185
184
  var borderRadius = 12;
@@ -191,7 +190,7 @@ var draw = function (layout, dimensions, pathRef, ctx) {
191
190
  var endPointY = 65 + layout.itemSpacing * i;
192
191
  drawLable(v.name, 0, endPointY, ctx);
193
192
  pathRef.push({ x: 0, y: y, width: layout.leftLableWidth, height: 22, tips: "".concat(v.name, ": ").concat(v.score) });
194
- var score = (_a = v.score) !== null && _a !== void 0 ? _a : (v.score < 4 ? 4 : v.score);
193
+ var score = v.score === 0 ? 0 : Math.max(v.score, 4);
195
194
  drawScore(layout, ctx, config, {
196
195
  x: layout.leftLableWidth,
197
196
  y: y,
@@ -221,6 +220,12 @@ var Graph = function (_a) {
221
220
  tipEl.style.fontSize = '12px';
222
221
  tipEl.style.display = 'none';
223
222
  document.body.appendChild(tipEl);
223
+ // Clean up the tooltip element when items change
224
+ return function () {
225
+ if (tipEl.parentNode) {
226
+ tipEl.parentNode.removeChild(tipEl);
227
+ }
228
+ };
224
229
  }, [ref, items]);
225
230
  useEffect(function () {
226
231
  if (ctx) {
@@ -183,7 +183,6 @@ var draw = function (layout, dimensions, pathRef, ctx) {
183
183
  ctx.font = '16px sans-serif';
184
184
  ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
185
185
  dimensions.forEach(function (v, i) {
186
- var _a;
187
186
  var config = getLevel(v.score);
188
187
  // 绘制圆角矩形
189
188
  var borderRadius = 12;
@@ -195,7 +194,7 @@ var draw = function (layout, dimensions, pathRef, ctx) {
195
194
  var endPointY = 65 + layout.itemSpacing * i;
196
195
  drawLable(v.name, 0, endPointY, ctx);
197
196
  pathRef.push({ x: 0, y: y, width: layout.leftLableWidth, height: 22, tips: "".concat(v.name, ": ").concat(v.score) });
198
- var score = (_a = v.score) !== null && _a !== void 0 ? _a : (v.score < 4 ? 4 : v.score);
197
+ var score = v.score === 0 ? 0 : Math.max(v.score, 4);
199
198
  drawScore(layout, ctx, config, {
200
199
  x: layout.leftLableWidth,
201
200
  y: y,
@@ -225,6 +224,12 @@ var Graph = function (_a) {
225
224
  tipEl.style.fontSize = '12px';
226
225
  tipEl.style.display = 'none';
227
226
  document.body.appendChild(tipEl);
227
+ // Clean up the tooltip element when items change
228
+ return function () {
229
+ if (tipEl.parentNode) {
230
+ tipEl.parentNode.removeChild(tipEl);
231
+ }
232
+ };
228
233
  }, [ref, items]);
229
234
  (0, react_1.useEffect)(function () {
230
235
  if (ctx) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eli-video-interview",
3
- "version": "1.2.42-alpha.34",
3
+ "version": "1.2.42-alpha.35",
4
4
  "description": "鳄梨科技 AI视频面试 React SDK",
5
5
  "author": "鳄梨科技",
6
6
  "license": "MIT",