Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ public boolean isEmpty() {
return rows.isEmpty();
}

public List<Row> getRows() {
return List.copyOf(rows);
}

@Override
public List<? extends LytNode> getChildren() {
return childNodes;
Expand Down Expand Up @@ -228,19 +232,32 @@ private static void drawHorizontalLine(RenderContext context, int xStart, int xE
context.fillRect(new LytRect(left, y, width, CONNECTOR_THICKNESS), color);
}

private static class Row {
public static class Row {

final List<SlotKind> slots;
private final List<SlotKind> slots;
@Nullable
final LytBlock iconBlock;
final LytParagraph payload;
int rowY;
int rowHeight;
private final LytBlock iconBlock;
private final LytParagraph payload;
private int rowY;
private int rowHeight;

Row(List<SlotKind> slots, @Nullable LytBlock iconBlock, LytParagraph payload) {
this.slots = slots;
this.iconBlock = iconBlock;
this.payload = payload;
}

public List<SlotKind> getSlots() {
return slots;
}

@Nullable
public LytBlock getIconBlock() {
return iconBlock;
}

public LytParagraph getPayload() {
return payload;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class LytMermaidFlowchart extends LytVBox implements InteractiveElement {
@Getter
private final LytCodeBlockToolbar toolbar = new LytCodeBlockToolbar();
private final LytMermaidFlowchartCanvas canvas;
@Getter
private final Map<String, LytBlock> nodeContent;

public LytMermaidFlowchart(FlowchartDocument flowchart, String sourceText) {
this(flowchart, sourceText, Collections.emptyMap());
Expand All @@ -32,6 +34,7 @@ public LytMermaidFlowchart(FlowchartDocument flowchart, String sourceText) {
public LytMermaidFlowchart(FlowchartDocument flowchart, String sourceText, Map<String, LytBlock> nodeContent) {
this.flowchart = flowchart;
this.sourceText = sourceText != null ? sourceText : "";
this.nodeContent = nodeContent != null ? Map.copyOf(nodeContent) : Collections.emptyMap();
this.canvas = new LytMermaidFlowchartCanvas(
flowchart,
nodeContent != null ? nodeContent : Collections.emptyMap());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class LytMermaidMindmap extends LytVBox implements InteractiveElement {
private final String sourceText;
private final LytCodeBlockToolbar toolbar = new LytCodeBlockToolbar();
private final LytMermaidMindmapCanvas canvas;
private final Map<String, LytBlock> nodeContent;

public LytMermaidMindmap(MindmapDocument mindmap, String sourceText) {
this(mindmap, sourceText, Collections.emptyMap());
Expand All @@ -30,6 +31,7 @@ public LytMermaidMindmap(MindmapDocument mindmap, String sourceText) {
public LytMermaidMindmap(MindmapDocument mindmap, String sourceText, Map<String, LytBlock> nodeContent) {
this.mindmap = mindmap;
this.sourceText = sourceText != null ? sourceText : "";
this.nodeContent = nodeContent != null ? Map.copyOf(nodeContent) : Collections.emptyMap();
this.canvas = new LytMermaidMindmapCanvas(mindmap, nodeContent != null ? nodeContent : Collections.emptyMap());

setPadding(6);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,22 @@ public class LytBarChart extends LytChartBase implements DebugComponent {
private ChartAxisOptions yAxis = new ChartAxisOptions();
private float barWidthRatio = 0.7f;

public String[] getCategories() {
return categories.clone();
}

public ChartAxisOptions getXAxis() {
return xAxis;
}

public ChartAxisOptions getYAxis() {
return yAxis;
}

public float getBarWidthRatio() {
return barWidthRatio;
}

private LytRect plotCache = LytRect.empty();
private AxisRange xRangeCache;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ public abstract class LytChartBase extends LytBlock implements InteractiveElemen
@Setter
private int cornerLegendBackgroundColor = CornerLegendRenderer.DEFAULT_BACKGROUND;

public int getExplicitWidth() {
return explicitWidth;
}

public int getExplicitHeight() {
return explicitHeight;
}

/** Currently hovered hit key; {@code -1} means none. The exact semantics is decided by each subclass. */
protected int hoveredKey = -1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,22 @@ public class LytColumnChart extends LytChartBase implements DebugComponent {
private ChartAxisOptions yAxis = new ChartAxisOptions();
private float barWidthRatio = 0.7f;

public String[] getCategories() {
return categories.clone();
}

public ChartAxisOptions getXAxis() {
return xAxis;
}

public ChartAxisOptions getYAxis() {
return yAxis;
}

public float getBarWidthRatio() {
return barWidthRatio;
}

private LytRect plotCache = LytRect.empty();
private AxisRange yRangeCache;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,26 @@ public class LytLineChart extends LytChartBase {
@Setter
private boolean showPoints = true;

public String[] getCategories() {
return categories.clone();
}

public ChartAxisOptions getXAxis() {
return xAxis;
}

public ChartAxisOptions getYAxis() {
return yAxis;
}

public boolean isNumericX() {
return numericX;
}

public boolean isShowPoints() {
return showPoints;
}

private LytRect plotCache = LytRect.empty();
private AxisRange xRangeCache;
private AxisRange yRangeCache;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ public class LytPieChart extends LytChartBase implements DebugComponent {
@Setter
private boolean clockwise = true;

public float getStartAngleDeg() {
return startAngleDeg;
}

public boolean isClockwise() {
return clockwise;
}

private float cxCache;
private float cyCache;
private float radiusCache;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ public class LytScatterChart extends LytChartBase {
private ChartAxisOptions xAxis = new ChartAxisOptions();
private ChartAxisOptions yAxis = new ChartAxisOptions();

public ChartAxisOptions getXAxis() {
return xAxis;
}

public ChartAxisOptions getYAxis() {
return yAxis;
}

private LytRect plotCache = LytRect.empty();
private AxisRange xRangeCache;
private AxisRange yRangeCache;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@ public interface AssetLoader {

private final GuideSiteAssetRegistry assets;
private final AssetLoader assetLoader;
private final GuideSiteLatexExporter latexExporter;
private final Map<ResourceLocation, String> exportedResourcePaths = new HashMap<>();
private final Map<ResourceLocation, String> exportedSoundPaths = new HashMap<>();

public GuideSitePageAssetExporter(GuideSiteAssetRegistry assets, AssetLoader assetLoader) {
this.assets = assets;
this.assetLoader = assetLoader;
this.latexExporter = new GuideSiteLatexExporter(assets);
}

public GuideSiteLatexExporter latexExporter() {
return latexExporter;
}

public String resolveImageSrc(String rawUrl, @Nullable ResourceLocation currentPageId) {
Expand Down
Loading