Skip to content

Instantly share code, notes, and snippets.

@zsoltk
Created July 28, 2021 07:50
Show Gist options
  • Save zsoltk/b9cc14d5f4aa0580c91612243803e6db to your computer and use it in GitHub Desktop.
Save zsoltk/b9cc14d5f4aa0580c91612243803e6db to your computer and use it in GitHub Desktop.
interface DatasetVisualisation : Parcelable {
// String resource
val name: Int
// Global minimum value
val minValue: Int
// Global maximum value
val maxValue: Int
fun dataPointAt(position: Position, state: GameSnapshotState): Datapoint?
}
data class Datapoint(
val value: Int?, // will be coerced to [minValue, maxValue range]
val label: String?, // optionally display a label
val colorScale: Pair<Color, Color>, // the colour range
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment