{"spec_id":"line-markers","library":"echarts","language":"javascript","code":"// anyplot.ai\n// line-markers: Line Plot with Markers\n// Library: echarts 6.1.0 | JavaScript 22.23.2\n// Quality: 87/100 | Created: 2026-09-05\n\nconst t = window.ANYPLOT_TOKENS;\n\n// --- Data (in-memory, deterministic) ----------------------------------------\n// Michaelis-Menten enzyme kinetics: v = Vmax * [S] / (Km + [S]), plus a small\n// deterministic measurement jitter (fixed-seed LCG — no Math.random in browser).\nlet seed = 42;\nfunction lcgNoise(scale) {\n  seed = (seed * 1103515245 + 12345) & 0x7fffffff;\n  return (seed / 0x7fffffff - 0.5) * 2 * scale;\n}\n\nconst substrate = [0.5, 1, 2, 3, 5, 8, 12, 18, 25, 35, 45];\n\nfunction michaelisMenten(vmax, km) {\n  return substrate.map((s) => {\n    const rate = (vmax * s) / (km + s);\n    return Math.round((rate + lcgNoise(2.2)) * 10) / 10;\n  });\n}\n\nconst wildTypeVmax = 98;\nconst mutantVmax = 65;\nconst wildType = michaelisMenten(wildTypeVmax, 4.5);\nconst mutant = michaelisMenten(mutantVmax, 14);\n\n// --- Init --------------------------------------------------------------------\nconst chart = echarts.init(document.getElementById(\"container\"));\n\n// --- Option --------------------------------------------------------------------\nchart.setOption({\n  animation: false,\n  color: t.palette,\n  backgroundColor: \"transparent\",\n  title: {\n    text: \"Enzyme Kinetics · line-markers · javascript · echarts · anyplot.ai\",\n    left: \"center\",\n    top: 20,\n    textStyle: { color: t.ink, fontSize: 22, fontWeight: 500 },\n  },\n  legend: {\n    data: [\"Wild-type\", \"Mutant\"],\n    top: 76,\n    textStyle: { color: t.inkSoft, fontSize: 16 },\n    itemWidth: 24,\n    itemHeight: 14,\n  },\n  grid: { left: 100, right: 70, top: 150, bottom: 100 },\n  xAxis: {\n    type: \"value\",\n    name: \"Substrate Concentration (mM)\",\n    nameLocation: \"middle\",\n    nameGap: 46,\n    nameTextStyle: { color: t.ink, fontSize: 18 },\n    min: 0,\n    max: 46,\n    axisLabel: { color: t.inkSoft, fontSize: 14 },\n    axisLine: { lineStyle: { color: t.inkSoft } },\n    axisTick: { show: false },\n    splitLine: { show: false },\n  },\n  yAxis: {\n    type: \"value\",\n    name: \"Reaction Rate (µM/min)\",\n    nameLocation: \"middle\",\n    nameGap: 64,\n    nameTextStyle: { color: t.ink, fontSize: 18 },\n    min: 0,\n    axisLabel: { color: t.inkSoft, fontSize: 14 },\n    axisLine: { show: false },\n    axisTick: { show: false },\n    splitLine: { lineStyle: { color: t.grid } },\n  },\n  series: [\n    {\n      name: \"Wild-type\",\n      type: \"line\",\n      data: substrate.map((s, i) => [s, wildType[i]]),\n      symbol: \"circle\",\n      symbolSize: 16,\n      lineStyle: { width: 3.5, color: t.palette[0] },\n      itemStyle: { color: t.palette[0], borderColor: t.pageBg, borderWidth: 2 },\n      markLine: {\n        symbol: \"none\",\n        silent: true,\n        label: { formatter: \"Wild-type Vmax\", color: t.palette[0], fontSize: 13, position: \"insideEndTop\" },\n        lineStyle: { type: \"dashed\", color: t.palette[0], opacity: 0.5, width: 1.5 },\n        data: [{ yAxis: wildTypeVmax }],\n      },\n    },\n    {\n      name: \"Mutant\",\n      type: \"line\",\n      data: substrate.map((s, i) => [s, mutant[i]]),\n      symbol: \"diamond\",\n      symbolSize: 18,\n      lineStyle: { width: 3.5, color: t.palette[1] },\n      itemStyle: { color: t.palette[1], borderColor: t.pageBg, borderWidth: 2 },\n      markLine: {\n        symbol: \"none\",\n        silent: true,\n        label: { formatter: \"Mutant Vmax\", color: t.palette[1], fontSize: 13, position: \"insideEndTop\" },\n        lineStyle: { type: \"dashed\", color: t.palette[1], opacity: 0.5, width: 1.5 },\n        data: [{ yAxis: mutantVmax }],\n      },\n    },\n  ],\n});\n"}