{"record":{"id":"1943e95f9dff71f0","repo":"mrdoob/three.js","slug":"no-diagram-name-1943e9","errorCode":null,"errorMessage":"no diagram ${name}","messagePattern":"no diagram (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"manual/resources/threejs-post-processing-3dlut.js","lineNumber":132,"sourceCode":"\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t}, 500 );\n\n\t\t\t},\n\t\t},\n\t};\n\n\t[ ...document.querySelectorAll( '[data-diagram]' ) ].forEach( createDiagram );\n\n\tfunction createDiagram( base ) {\n\n\t\tconst name = base.dataset.diagram;\n\t\tconst info = diagrams[ name ];\n\t\tif ( ! info ) {\n\n\t\t\tthrow new Error( `no diagram ${name}` );\n\n\t\t}\n\n\t\tinfo.init( base );\n\n\t}\n\n}\n\n","sourceCodeStart":114,"sourceCodeEnd":142,"githubUrl":"https://github.com/mrdoob/three.js/blob/da05705fa31f02710c19772a2aa70c7454807f0c/manual/resources/threejs-post-processing-3dlut.js#L114-L142","documentation":"Thrown by the threejs-post-processing-3dlut lesson's createDiagram() when a page element has a data-diagram attribute with no matching entry in that file's diagrams object. Identical pattern to the other lessons, but this lesson calls info.init(base) (rather than info.create) once the diagram is resolved.","triggerScenarios":"A data-diagram attribute in the 3D LUT lesson page whose value is not a key in the local diagrams map. Renaming the diagrams object keys without updating the HTML, or adding a demo element without registering it.","commonSituations":"Adapting the post-processing LUT lesson: you add a second comparison canvas with a new data-diagram name and forget to define diagrams.<name> with an init(base) method.","solutions":["List every data-diagram value in the lesson HTML and confirm each has a key in the diagrams object.","Add the missing diagram entry, exposing an init(base) method (this lesson calls info.init, not info.create).","Remove the attribute from elements that are not diagrams."],"exampleFix":"// before\nconst diagrams = {\n  lut: { init: initLut },\n};\n// HTML: <div data-diagram=\"original\"> -> throws\n\n// after\nconst diagrams = {\n  lut: { init: initLut },\n  original: { init: initOriginal },\n};","handlingStrategy":"validation","validationCode":"function assertDiagramsRegistered( diagrams ) {\n  const missing = [ ...document.querySelectorAll( '[data-diagram]' ) ]\n    .map( el => el.dataset.diagram )\n    .filter( name => ! diagrams[ name ] );\n  if ( missing.length ) throw new Error( `Unregistered diagrams: ${missing.join( ', ' )}` );\n}","typeGuard":"function isDiagramInfo( v ) {\n  return v !== null && typeof v === 'object' && typeof v.init === 'function';\n}","tryCatchPattern":"[ ...document.querySelectorAll( '[data-diagram]' ) ].forEach( base => {\n  const info = diagrams[ base.dataset.diagram ];\n  if ( ! info ) { console.warn( 'skip unknown diagram:', base.dataset.diagram ); return; }\n  try { info.init( base ); } catch ( e ) { console.error( base.dataset.diagram, e ); }\n} );","preventionTips":["Remember this lesson calls info.init(base), not info.create — match the method shape.","Keep data-diagram attributes and diagrams keys in sync when editing the lesson.","Add a coverage check during local development."],"tags":["manual","diagram","lesson","post-processing","dom-driven"],"backgroundTag":null,"analyzedSha":"da05705fa31f02710c19772a2aa70c7454807f0c","analyzedAt":"2026-08-12T22:51:37.160Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}