Public
Edited
Jun 23, 2023
Insert cell
Insert cell
data = [{
"id": "649547c718396bb4f7bd5be0",
"type": "中药",
"full_name": "巴豆",
"short_name": "BD",
"secrecy": false,
"secrecy_code": "",
"price": 15,
"tag": null,
"feature": null,
"stock_info": null
},
{
"id": "6495483818396bb4f7bd5be1",
"type": "中药",
"full_name": "板蓝根",
"short_name": "BLG",
"secrecy": false,
"secrecy_code": "",
"price": 15,
"tag": null,
"feature": null,
"stock_info": null
},
{
"id": "6495489718396bb4f7bd5be2",
"type": "中药",
"full_name": "生姜",
"short_name": "SJ",
"secrecy": false,
"secrecy_code": "",
"price": 15,
"tag": null,
"feature": null,
"stock_info": null
},
{
"id": "649548b118396bb4f7bd5be3",
"type": "中药",
"full_name": "白芷",
"short_name": "BZ",
"secrecy": false,
"secrecy_code": "",
"price": 15,
"tag": null,
"feature": null,
"stock_info": null
},
{
"id": "649548db18396bb4f7bd5be4",
"type": "中药",
"full_name": "熊胆",
"short_name": "XD",
"secrecy": false,
"secrecy_code": "",
"price": 15,
"tag": null,
"feature": null,
"stock_info": null
},
{
"id": "64930627494753e8e309e1b6",
"type": "中药",
"full_name": "当归",
"short_name": "DG",
"secrecy": true,
"secrecy_code": "1",
"price": 15,
"tag": null,
"feature": null,
"stock_info": {
"TotalStock": 0,
"StockWarning": 0,
"Batch": null
}
},
{
"id": "64954481d39ecc18cef172f9",
"type": "中药",
"full_name": "八角",
"short_name": "BJ",
"secrecy": false,
"secrecy_code": "",
"price": 15,
"tag": null,
"feature": null,
"stock_info": null
}
]
Insert cell
{
const pinyinEngine = new PinyinEngine(data, ['full_name']);

// 查询
return pinyinEngine.query('BJ');
}
Insert cell
PinyinEngine = require('pinyin-engine');
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more