-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
CartesianMarker
-related updates (WIP)
- Loading branch information
1 parent
ac8deca
commit 908fbfb
Showing
23 changed files
with
452 additions
and
449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...rc/main/java/com/patrykandpatrick/vico/compose/cartesian/marker/DefaultCartesianMarker.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright 2024 by Patryk Goworowski and Patrick Michalik. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.patrykandpatrick.vico.compose.cartesian.marker | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
import com.patrykandpatrick.vico.core.cartesian.marker.CartesianMarkerLabelFormatter | ||
import com.patrykandpatrick.vico.core.cartesian.marker.DefaultCartesianMarker | ||
import com.patrykandpatrick.vico.core.cartesian.marker.DefaultCartesianMarkerLabelFormatter | ||
import com.patrykandpatrick.vico.core.common.component.Component | ||
import com.patrykandpatrick.vico.core.common.component.LineComponent | ||
import com.patrykandpatrick.vico.core.common.component.TextComponent | ||
|
||
/** Creates and remembers a [DefaultCartesianMarker]. */ | ||
@Composable | ||
public fun rememberDefaultCartesianMarker( | ||
label: TextComponent, | ||
labelFormatter: CartesianMarkerLabelFormatter = remember { DefaultCartesianMarkerLabelFormatter() }, | ||
labelPosition: DefaultCartesianMarker.LabelPosition = DefaultCartesianMarker.LabelPosition.Top, | ||
indicator: Component? = null, | ||
indicatorSize: Dp = 0.dp, | ||
setIndicatorColor: ((Int) -> Unit)? = null, | ||
guideline: LineComponent? = null, | ||
): DefaultCartesianMarker = | ||
remember(label, labelFormatter, labelPosition, indicator, indicatorSize, setIndicatorColor, guideline) { | ||
DefaultCartesianMarker( | ||
label, | ||
labelFormatter, | ||
labelPosition, | ||
indicator, | ||
indicatorSize.value, | ||
setIndicatorColor, | ||
guideline, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 0 additions & 77 deletions
77
...mpose/src/main/java/com/patrykandpatrick/vico/compose/common/component/MarkerComponent.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.