我有一个脚本,可以生成 SVG 图像文件和 SVG 文件中心的其他内容。围绕这些图像 - 白色背景。如何修剪背景?\nSVG 中的图像大小可能不同。
\n\n示例 \xe2\x80\x94 我想从 svg 中删除白色区域并仅留下蓝色图像。
\n\n
例如,我有 3 个模型:
故事:
{
title: { type: String },
text: { type: String }
}
Run Code Online (Sandbox Code Playgroud)
注释:
{
text: { type: String },
story: { type: mongoose.Schema.Types.ObjectId, ref: "Stories" }
}
Run Code Online (Sandbox Code Playgroud)
喜欢:
{
story: { type: mongoose.Schema.Types.ObjectId, ref: "Stories" }
}
Run Code Online (Sandbox Code Playgroud)
如果受欢迎程度取决于评论和喜欢的数量,我如何获得最受欢迎的故事?例如,如果故事有更多的评论和喜欢,它就会更受欢迎。
谢谢。
更新:示例数据。
Stories:
{
"title": "First story",
"text": "This must be the MOST popular story..."
}
{
"title": "Second story",
"text": "This story is popular too, but not as the first story."
}
{
"title": "Third story",
"text": …Run Code Online (Sandbox Code Playgroud)