javascript - Parse SVG path from string in JavaScript
问题描述
I need to parse a SVG path composed of M and C commands:
M 9.50,12.787
C 10 10 10 90 10 90
C 10 90 90 90 90 90
C 90 90 90 10 90 10
C 90 10 10 10 10 10
C 10 10 10 10 10 10
M 20,20
C 20 20 80 80 80 80
C 80 80 20 80 20 80
C 20 80 20 20 20 20
C 20 20 20 20 20 20
I need to convert the string into an array containing the commands and the associated points. I'm not familiar with parsing, and I don't know what is the best practice to avoid building a labyrinthine system.
解决方案
推荐阅读
- python - 用值 Python-Pandas 替换空单元格
- c# - 解析中间件中的请求标头属性,用于特定路由 - ASP.NET CORE
- matlab - 如何在 MATLAB 中读取 .mtx 文件矩阵以计算特征值和特征向量?
- javascript - 无法获取输入元素的值
- .net - 具有事件驱动架构但没有事件溯源的 CQRS
- node.js - supervisord 没有在停止命令上杀死所有生成的节点进程
- python - 在heroku上部署streamlit webapp的问题
- ios - MTKView Transparency
- javascript - How to show multiple attachments in JavaScript
- gitlab - CI 与 QAC + Gitlab / 集成