message: extract getStructureQuality helper
diff: @@ -52,30 +52,33 @@ export interface QualityProps {
  resolution: number
  }
  -export function getQualityProps(props: Partial<QualityProps>, data?: any) {
  - let quality = defaults(props.quality, 'auto' as VisualQuality)
  - let detail = defaults(props.detail, 1)
  - let radialSegments = defaults(props.radialSegments, 12)
  - let linearSegments = defaults(props.linearSegments, 8)
  - let resolution = defaults(props.resolution, 2)
  -
  - if (quality === 'auto' && data instanceof Structure) {
  - const structure = data.root
  +export function getStructureQuality(structure: Structure): VisualQuality {
  let score = structure.elementCount
  if (structure.isCoarse) score *= 10
  if (score > 500_000) {
  - quality = 'lowest'
  + return 'lowest'
  } else if (score > 200_000) {
  - quality = 'lower'
  + return 'lower'
  } else if (score > 60_000) {
  - quality = 'low'
  + return 'low'
  } else if (score > 20_000) {
  - quality = 'medium'
  + return 'medium'
  } else if (score > 2_000) {
  - quality = 'high'
  + return 'high'
  } else {
  - quality = 'higher'
  + return 'higher'
  + }
  }
  +
  +export function getQualityProps(props: Partial<QualityProps>, data?: any) {
  + let quality = defaults(props.quality, 'auto' as VisualQuality)
  + let detail = defaults(props.detail, 1)
  + let radialSegments = defaults(props.radialSegments, 12)
  + let linearSegments = defaults(props.linearSegments, 8)
  + let resolution = defaults(props.resolution, 2)
  +
  + if (quality === 'auto' && data instanceof Structure) {
  + quality = getStructureQuality(data.root)
  }
  switch (quality) {
  