# deriveMappingFromGraph

Canonical: https://docs.shumoku.dev/ja/library/api/deriveMappingFromGraph
Language: ja

@shumoku/core · 0.4.0 · function

# deriveMappingFromGraph

[ソース](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/observation/metrics-binding.ts#L57)

APIの説明は英語のcanonical sourceを表示しています。

Derive a legacy \`MetricsMapping\` from a resolved graph's bindings. - Node host binding → \`mapping.nodes\[node.id\]\`. - Link interface binding lives on a \`NodePort\`; we attribute it to the link whose endpoint references that port, keyed \`link.id || link-${i}\` to match the rest of the server (server.ts / topologies.ts). Pure; never mutates the input.

```
deriveMappingFromGraph(graph: NetworkGraph, activeSourceIds?: ReadonlySet<string>): MetricsMapping
```

## パラメーター

| 名前 | 型 | 説明 | 既定値 |
| --- | --- | --- | --- |
| `graph` | `NetworkGraph` | 追加説明はありません。 | `—` |
| `activeSourceIds` | `ReadonlySet<string>` | 追加説明はありません。 | `—` |

## 戻り値

```
MetricsMapping
```

[`libs/@shumoku/core/src/observation/metrics-binding.ts:57`](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/observation/metrics-binding.ts#L57)
