image-ellipses.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. const config = `
  2. <View>
  3. <Image name="img" value="$image"></Image>
  4. <EllipseLabels name="tag" toName="img" fillOpacity="0.5" strokeWidth="3">
  5. <Label value="Hello" background="yellow"></Label>
  6. <Label value="World" background="red"></Label>
  7. </EllipseLabels>
  8. <Choices name="choice" toName="img">
  9. <Choice value="Space" />
  10. <Choice value="Underground" />
  11. </Choices>
  12. </View>
  13. `;
  14. const data = {
  15. image:
  16. "https://htx-pub.s3.us-east-1.amazonaws.com/examples/images/nick-owuor-astro-nic-visuals-wDifg5xc9Z4-unsplash.jpg",
  17. };
  18. const result = [
  19. {
  20. from_name: "tag",
  21. id: "CPnIaS1e7v",
  22. image_rotation: 0,
  23. original_height: 2802,
  24. original_width: 2242,
  25. to_name: "img",
  26. type: "ellipselabels",
  27. origin: "manual",
  28. value: {
  29. x: 50.4,
  30. y: 50.76307363927427,
  31. ellipselabels: ["Hello"],
  32. rotation: 0,
  33. radiusY: 10.672358591248665,
  34. radiusX: 13.333333333333334,
  35. },
  36. },
  37. {
  38. from_name: "tag",
  39. id: "CPnIaS1e8v",
  40. image_rotation: 0,
  41. original_height: 2802,
  42. original_width: 2242,
  43. to_name: "img",
  44. type: "ellipselabels",
  45. origin: "manual",
  46. value: {
  47. x: 80,
  48. y: 80,
  49. ellipselabels: ["World"],
  50. rotation: 0,
  51. radiusY: 5,
  52. radiusX: 7,
  53. },
  54. },
  55. {
  56. from_name: "choice",
  57. id: "CkRNBWbSiK",
  58. to_name: "img",
  59. type: "choices",
  60. origin: "manual",
  61. value: {
  62. choices: ["Space"],
  63. },
  64. },
  65. ];
  66. const title = "Ellipses on Image";
  67. module.exports = { config, data, result, title };