${h.chinese ? html`${h.chinese}` : nothing} ${h.pinyin ? html` ยท ${h.pinyin}` : nothing}
${h.judgment}
` : nothing } ${h.image && readings ? html`${h.image}
` : nothing} ${dailyMessage && readings ? html`` : nothing} ${ h.interpretation?.general && readings ? html`${h.interpretation.general}
` : nothing } ${ changing.size > 0 ? html`${l.meaning}
` : nothing, })); return this.renderInterpretation( sections, name, isCast ? 'Changing lines' : 'Lines', ); } /** * Lines for a static hexagram (a lookup, a random draw, the hexagram of the day, none of which carry a cast `lines` array): read the `binary` pattern. 6 digits BOTTOM to top, so index 0 is line 1, the bottom line, exactly like the cast `lines` array. 1 = yang (solid, 7), 0 = yin (broken, 8). A response with no usable `binary` yields no lines and the figure is left undrawn, because the six lines ARE response data: a default pattern would draw one hexagram under the name and Unicode symbol of another. The Unicode `symbol` block (U+4DC0) is in King Wen order, NOT line order, so it must never be a source for the lines either. * * @remarks * **Read in the order the API documents and never reversed.** `binary` and the cast `lines` array both run bottom to top, so they point the same way and a `.reverse()` here would flip every asymmetric hexagram upside down. Do not add one. */ private derivedLines(h: Hexagram): number[] { const binary = h.binary ?? ''; if (/^[01]{6}$/.test(binary)) { return Array.from(binary, (c) => (c === '1' ? 7 : 8)); } return []; } } declare global { interface HTMLElementTagNameMap { 'roxy-hexagram': RoxyHexagram; } }