Skip to content

Commit 76d8e7b

Browse files
Merge branch 'dev' into lp_update
2 parents ffad354 + 6231892 commit 76d8e7b

File tree

9 files changed

+9
-25
lines changed

9 files changed

+9
-25
lines changed

kandy-api/src/main/kotlin/org/jetbrains/kotlinx/kandy/dsl/internal/dataframe/concatFixed.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ internal fun <T, R> GroupBy<T, R>.concatFixed(): DataFrame<R> {
1313
return mapToFrames {
1414
val rowsCount = group.rowsCount()
1515
val keyColumns = keyNames.filter { it !in group.columnNames() }.map { keyName ->
16-
DataColumn.Companion.createByType(keyName, List(rowsCount) { key[keyName] }, Infer.Type)
16+
DataColumn.createByType(keyName, List(rowsCount) { key[keyName] }, Infer.Type)
1717
}
1818
group.addAll(keyColumns)
1919
}.concat()

kandy-geo/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/geo/dsl/GeoData.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ internal class GeoData(val geoDataFrame: GeoDataFrame<*>) : GeoSpatialData {
1414
override val dataFrame: DataFrame<WithGeometry> = geoDataFrame.df
1515

1616
companion object {
17-
// TODO lets-plot default, encoding precision customization
17+
// TODO(https://github.com/Kotlin/kandy/issues/454)
1818
const val DEFAULT_PRECISION = 10
1919
}
2020

kandy-geo/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/geo/layers/geoLayer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ internal fun <T> LayerCreatorScope.geoLayer(
3434
// override dataset if datasetBuilder size doesn't match
3535
dataFrameOf(geometryColumn).toGeo(null)
3636
} else {
37-
// TODO improve logic if the other geometry column with the same size is used
37+
// TODO(https://github.com/Kotlin/kandy/issues/456)
3838
// add geometry column otherwise
3939
(datasetBuilder as DatasetBuilderImpl).baseDataFrame.add(geometryColumn).toGeo()
4040
}

kandy-geo/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/geo/layers/geoMap.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import org.locationtech.jts.geom.MultiPolygon
2121
import org.locationtech.jts.geom.Polygon
2222
import kotlin.reflect.typeOf
2323

24-
// TODO add ColumnAccessor & String api
2524

2625
@PublishedApi
2726
internal fun CoordinateReferenceSystem.isWGS84(): Boolean {
@@ -75,7 +74,7 @@ public inline fun GeoDataScope.geoMap(
7574
if (crs == null || crs.isWGS84() == true) {
7675
(this as LayerCreatorScope).plotBuilder.coordinatesTransformation = CoordinatesTransformation.mercator()
7776
} else {
78-
//TODO handling other CRS
77+
// other CRSs are not supported yet in Lets-Plot
7978
}
8079
geoPolygon(block)
8180
}

kandy-geo/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/geo/layers/geoPath.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,14 @@ import kotlin.reflect.typeOf
6161
public inline fun GeoDataScope.geoPath(
6262
block: PathBuilder.() -> Unit = {}
6363
) {
64-
geometry().forEach {
65-
if (it !is Lineal) {
66-
error("Not a path geometry: $it")
67-
}
68-
}
64+
geometry().forEach { check(it is Lineal) { "Not a path geometry: $it" } }
6965
(this as LayerCreatorScope).path {
7066
x.constant(null)
7167
y.constant(null)
7268
block()
7369
}
7470
}
7571

76-
// TODO add ColumnAccessor & String api
7772
/**
7873
* Adds a new `path` layer to the plot.
7974
*

kandy-geo/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/geo/layers/geoPoints.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,14 @@ import kotlin.reflect.typeOf
6262
public inline fun GeoDataScope.geoPoints(
6363
block: PointsBuilder.() -> Unit = {}
6464
) {
65-
geometry().forEach {
66-
if (it !is Puntal) {
67-
error("Not a points geometry: $it")
68-
}
69-
}
65+
geometry().forEach { check(it is Puntal) { "Not a points geometry: $it" } }
7066
(this as LayerCreatorScope).points {
7167
x.constant(null)
7268
y.constant(null)
7369
block()
7470
}
7571
}
7672

77-
// TODO add ColumnAccessor & String api
7873
/**
7974
* Adds a new `points` layer to the plot.
8075
*

kandy-geo/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/geo/layers/geoPolygon.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,14 @@ import kotlin.reflect.typeOf
6060
public inline fun GeoDataScope.geoPolygon(
6161
block: PolygonBuilder.() -> Unit = {}
6262
) {
63-
geometry().forEach {
64-
if (it !is Polygonal) {
65-
error("Not a polygon geometry: $it")
66-
}
67-
}
63+
geometry().forEach { check(it is Polygonal) { "Not a polygon geometry: $it" } }
6864
(this as LayerCreatorScope).polygon {
6965
x.constant(null)
7066
y.constant(null)
7167
block()
7268
}
7369
}
7470

75-
// TODO add ColumnAccessor & String api
7671
/**
7772
* Adds a new `polygon` layer to the plot.
7873
*

kandy-geo/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/geo/layers/geoRectangles.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ public fun GeoDataScope.geoRectangles(
6767
}
6868
}
6969

70-
// TODO add ColumnAccessor & String api
7170
@JvmName("geoRectanglesGeometry")
7271
/**
7372
* Adds a new `rectangles` layer to the plot.

kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/data/GeoSpatialData.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import org.jetbrains.letsPlot.spatial.SpatialDataset
99
*
1010
* This interface extends the `TableData` interface, providing specific capabilities for handling geospatial data.
1111
*
12-
* @property dataFrame The data frame containing the geospatial data.
12+
* @property dataFrame The [DataFrame] containing the geospatial data.
13+
* @property toSpatialDataset converts dataset to Lets-Plot [SpatialDataset].
1314
*/
1415
public interface GeoSpatialData : TableData {
1516
public val dataFrame: DataFrame<*>

0 commit comments

Comments
 (0)