Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add withData #448

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open

Add withData #448

wants to merge 5 commits into from

Conversation

AndreiKingsley
Copy link
Collaborator

Partially solves #430.
Add withData {} that allows to modify dataset for layers. Supports DataFrame extensions.

* @param dataFrame The DataFrame to be used as a dataset within the scope.
* @param block layer creator scope with a new dataset.
*/
public inline fun <T> withData(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it be reflected somehow in tests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add tests later

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, at this stage of the library development, we should write tests right away. This will help us catch bugs faster, verify the API if it’s a public one, and reduce issues in the future

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

@AndreiKingsley
Copy link
Collaborator Author

Example:

val df1 = dataFrameOf(
    "x1" to listOf(1, 2, 5),
    "y1" to listOf(3, 4, 5)
)
val df2 = dataFrameOf(
    "x2" to listOf(3, 4, 5),
    "y2" to listOf(1, 2, 7)
)

df1.plot { 
    line { 
        x(x1)
        y(y1)
    }
    withData(df2) {
        points {
            x(x2)
            y(y2)   
        }
    }
}

@@ -11,7 +11,7 @@ dataframe = "0.14.1"
serialization = "1.6.3"
datetime = "0.6.0"
html = "0.11.0"
statistics = "0.3.1-dev-31"
statistics = "0.4.0-dev-8"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to separate our builds for release and dev

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approximately what is done in dataframe:

  • For stable releases or for M, RC versions, we manually change the version and run a release publish on the build server
  • For dev versions, we run publish with the dev flag (or explicitly differentiate between publish and dev publish), and a dev suffix with the build number is automatically added

This will eliminate the need for us to manually control dev versions

* @param dataFrame The DataFrame to be used as a dataset within the scope.
* @param block layer creator scope with a new dataset.
*/
public inline fun <T> withData(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, at this stage of the library development, we should write tests right away. This will help us catch bugs faster, verify the API if it’s a public one, and reduce issues in the future

@AndreiKingsley
Copy link
Collaborator Author

Added tests & docs

# Conflicts:
#	gradle/libs.versions.toml
Copy link
Collaborator

@devcrocod devcrocod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants