This file contains hidden or 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
@HiltViewModel | |
class ProductDetailViewModel @Inject constructor( | |
private val savedStateHandle: SavedStateHandle, | |
... | |
) : ViewModel() { | |
... | |
private fun getProductFromArgs(): ProductDetailArgs { |
This file contains hidden or 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
@Composable | |
fun LinearTransactionsChart( | |
modifier: Modifier = Modifier, | |
transactionsPerSecond: TransactionsPerSecond | |
) { | |
if (transactionsPerSecond.transactions.isEmpty()) return | |
Canvas(modifier = modifier) { | |
// Total number of transactions. | |
val totalRecords = transactionsPerSecond.transactions.size |
This file contains hidden or 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
/** | |
* Calculates the Y pixel coordinate for a given transaction rate. | |
* | |
* @param higherTransactionRateValue the highest rate value in the whole list of transactions. | |
* @param currentTransactionRate the current transaction RATE while iterating the list of transactions. | |
* @param canvasHeight the canvas HEIGHT for draw the linear chart. | |
* | |
* @return [Float] Y coordinate for a transaction rate. | |
*/ |
OlderNewer