Skip to content

Add {vector-sizing-calculator} directive #3051

@KOTungseth

Description

@KOTungseth

Summary

Wire the {vector-sizing-calculator} custom directive into elastic/docs-builder so the
interactive vector sizing calculator can be embedded in docs-content pages.

This is a prerequisite for the docs-content embed PR and must merge first.

Background

An open PR in elastic/docs-builder stages the React + EUI web component, directive examples,
and integration docs under tools/vector_sizing_calculator/. That PR includes three versions of
the calculator. Before opening this directive PR, Docs Eng must align on which version
to build from.

Scope

  • Add directive files under src/Elastic.Markdown/Myst/Directives/VectorSizing/:
    • VectorSizingBlock.cs
    • VectorSizingView.cshtml
    • VectorSizingViewModel.cs
  • Apply patches from DirectiveBlockParser.patch.md:
    • DirectiveBlockParser.cs — add VectorSizingBlock case before the UnknownDirectiveBlock fallback
    • DirectiveHtmlRenderer.cs — add WriteVectorSizing method and VectorSizingBlock case in the Write() switch
  • Update base HTML template — add <script src="/_static/vector-sizing-calculator.iife.js" defer></script>
  • Ship the compiled web component bundle (vector-sizing-calculator.iife.js) via standard bundle delivery

Out of scope

Formula updates, UI enhancements, and new element type support are owned by the Vector Search
team and tracked separately.

Prerequisites

  • Version selection decision resolved on the open docs-builder PR
  • BBQ constant accuracy question resolved (see formula accuracy issue)

Acceptance criteria

  • {vector-sizing-calculator} directive is recognized by the build system without errors
  • The compiled JS bundle loads correctly on pages where the directive is used
  • The directive renders a <vector-sizing-calculator> custom element in the output HTML
  • Integration guide verification checklist passes (element types, quantization combinations,
    HNSW and DiskBBQ advanced settings, cluster totals, formula panel accuracy)

Owner

Docs Eng

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions