el-beeswarm (main) doxdox documentation

El-beeswarm is a JavaScript library designed to easily create beeswarm plots. These charts are ideal for visualizing data distributions and relationships between variables. This library is lightweight, easy to use and highly customizable.

# constructor(htmlElementId)

Parameters

Name Types Description
htmlElementId htmlElementId - id do Elemnto html em objeto

# draw()

# et(dataset)

Parameters

Name Types Description
dataset dataset - dataset json

# resize()

# calculateSwarmPlotPositions(data, xScale, yScale, radius)

Calcula as posições dos pontos no gráfico SwarmPlot.

Parameters

Name Types Description
data Array - Os dados a serem posicionados.
xScale Object - A escala utilizada para o eixo x.
yScale Object - A escala utilizada para o eixo y.
radius number - O raio dos pontos.

# constructor(htmlElementId, data, xLabel, yLabel, radius, settings)

Cria uma nova instância de ScatterPlot.

Parameters

Name Types Description
htmlElementId string - O ID do elemento HTML no qual o gráfico será renderizado.
data Array - Os dados a serem exibidos no gráfico.
xLabel string - O rótulo do eixo x.
yLabel string - O rótulo do eixo y.
radius number - O raio dos pontos do gráfico. O valor padrão é 5.
settings Object - Configurações opcionais para o gráfico.

# draw()

Renderiza o gráfico Beeswarmplot.

# drawContainer()

Desenha o contêiner do gráfico.

# BeeswarmPlot()

Represents a beeswarm plot visualization.

# calculateSwarmPlotPositions(data, radius, padding, scale)

Calcula as posições dos pontos no gráfico de dispersão.

Parameters

Name Types Description
data Array - Os dados para os pontos.
radius number - O raio dos pontos.
padding number - O espaçamento entre os pontos.
scale Object - A escala utilizada para posicionar os pontos.

# constructor(htmlElementId, data, attr, radius, settings)

Creates an instance of BeeswarmPlot.

Parameters

Name Types Description
htmlElementId string - The ID of the HTML element to contain the visualization.
data Object[] - The data for the plot.
attr string - The attribute to visualize on the plot.
radius number - The radius of the circles in the plot.
settings Object - Additional settings for the plot.

# containForce(size, axis)

Aplica força para manter os pontos dentro dos limites do gráfico.

Parameters

Name Types Description
size number - O tamanho do eixo.
axis string - O eixo ao qual a força será aplicada ('x' ou 'y').

# draw()

Desenha o gráfico.

# drawAxis(x, y)

Desenha os eixos do gráfico.

Parameters

Name Types Description
x Object - A escala do eixo x.
y Object - A escala do eixo y.

# drawCircles(element, positionedData, colors, positions)

Desenha os pontos no formato de círculo.

Parameters

Name Types Description
element Object - O elemento SVG para desenhar os pontos.
positionedData Array - Os dados posicionados para os pontos.
colors Function - A função para obter a cor de um ponto.
positions Array - As posições x e y do ponto.

# drawDots(x, y)

Desenha os pontos no gráfico.

Parameters

Name Types Description
x Object - Os valores de coordenada x.
y Object - Os valores de coordenada y.

# drawHex(element, positionedData, colors, positions)

Desenha pontos no formato hexagonal.

Parameters

Name Types Description
element Object - O elemento SVG para desenhar os pontos.
positionedData Array - Os dados posicionados para os pontos.
colors Function - A função para obter a cor de um ponto.
positions Array - As posições x e y do ponto.

# intersects(x, y, head)

Verifica se um ponto intersecta outros pontos.

Parameters

Name Types Description
x number - A coordenada x do ponto.
y number - A coordenada y do ponto.
head Object - O primeiro ponto na lista de pontos.

# prepareData()

Prepares the data and returns the x and y scales based on the orientation and attribute.

# constructor(htmlElementId, width, height, settings)

Create a visualization.

Parameters

Name Types Description
htmlElementId string - The ID of the HTML element to attach the visualization to.
width number - The width of the visualization.
height number - The height of the visualization.
settings VisualizationSettings - The settings for the visualization.

# draw()

# drawCircles(element, positionedData, colors)

Draws circles on the specified element based on the provided positioned data and colors.

Parameters

Name Types Description
element d3.Selection - The element to draw the circles on.
positionedData Object[] - The data with x and y positions for each circle.
colors string[] undefined

# drawContainer()

# et(dataset)

Parameters

Name Types Description
dataset dataset - dataset json

# resize()

# setColor(attribute, colors)

Parameters

Name Types Description
attribute *
colors *

# this.attrTooltip()

The attributes to display tooltips for.

# this.axisX()

The X-axis layer for the visualization.

# this.axisY()

The Y-axis layer for the visualization.

# this.background()

The background layer for the visualization.

# this.container()

The container element for the visualization.

# this.divTitle()

The title element for the visualization.

# this.forenground()

The forenground layer for the visualization.

# this.hideTooltipTimeout()

The timeout for hiding the tooltip.

# this.highlight()

The highlight layer for the visualization.

# this.htmlBounds()

The bounds of the HTML element.

# this.legendDiv()

The legend element for the visualization.

# this.margin()

The margin of the visualization.

# this.padding()

The padding of the visualization.

# this.parentElement()

The parent element of the visualization.

# this.selected()

The selected elements in the visualization.

# this.settings()

The settings for the visualization.

# this.svg()

The SVG element for the visualization.

# this.title()

The title of the visualization.

# this.tooltip()

The tooltip element for the visualization.

# this.uuid()

The UUID of the visualization.

# VisualizationAbstract()

Class representing a visualization.