From 0129d2c9920ba9af400db31fa89c069cc82cef91 Mon Sep 17 00:00:00 2001 From: taewooyo Date: Wed, 17 Apr 2024 15:50:38 +0900 Subject: [PATCH] remove chart border and update example app --- README.md | 3 + app/build.gradle.kts | 9 +- app/src/main/AndroidManifest.xml | 48 +-- app/src/main/assets/stock.json | 394 ++++++++++++++++++ .../kotlin/com/taewooyo/volcano/Colors.kt | 21 +- .../main/kotlin/com/taewooyo/volcano/Dummy.kt | 129 ------ .../com/taewooyo/volcano/MainApplication.kt | 7 + .../volcano/core/assets/AssetLoader.kt | 21 + .../volcano/core/assets/di/AssetModule.kt | 19 + .../volcano/core/data/di/DataModule.kt | 16 + .../core/data/stock/StockRepository.kt | 9 + .../core/data/stock/StockRepositoryImpl.kt | 17 + .../taewooyo/volcano/core/model/StockItem.kt | 27 ++ .../taewooyo/volcano/{ => ui}/MainActivity.kt | 56 ++- .../com/taewooyo/volcano/ui/MainViewModel.kt | 32 ++ build.gradle.kts | 2 + gradle/libs.versions.toml | 26 +- .../com/taewooyo/volcano/compose/Volcano.kt | 4 +- .../volcano/squarified/SquarifiedMeasurer.kt | 48 +-- 19 files changed, 668 insertions(+), 220 deletions(-) create mode 100644 app/src/main/assets/stock.json delete mode 100644 app/src/main/kotlin/com/taewooyo/volcano/Dummy.kt create mode 100644 app/src/main/kotlin/com/taewooyo/volcano/MainApplication.kt create mode 100644 app/src/main/kotlin/com/taewooyo/volcano/core/assets/AssetLoader.kt create mode 100644 app/src/main/kotlin/com/taewooyo/volcano/core/assets/di/AssetModule.kt create mode 100644 app/src/main/kotlin/com/taewooyo/volcano/core/data/di/DataModule.kt create mode 100644 app/src/main/kotlin/com/taewooyo/volcano/core/data/stock/StockRepository.kt create mode 100644 app/src/main/kotlin/com/taewooyo/volcano/core/data/stock/StockRepositoryImpl.kt create mode 100644 app/src/main/kotlin/com/taewooyo/volcano/core/model/StockItem.kt rename app/src/main/kotlin/com/taewooyo/volcano/{ => ui}/MainActivity.kt (57%) create mode 100644 app/src/main/kotlin/com/taewooyo/volcano/ui/MainViewModel.kt diff --git a/README.md b/README.md index 66afc71..5dc30b2 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,10 @@

+ + +

## Volcano in Jetpack Compose diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 815ef57..6b3ecbb 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,9 +1,10 @@ import com.taewooyo.buildsrc.Configuration -@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed plugins { id(libs.plugins.android.application.get().pluginId) id(libs.plugins.kotlin.android.get().pluginId) + id(libs.plugins.hilt.plugin.get().pluginId) + id(libs.plugins.ksp.get().pluginId) } android { @@ -54,4 +55,10 @@ dependencies { implementation(libs.androidx.compose.foundation) implementation(libs.androidx.compose.runtime) implementation(libs.androidx.compose.constraintlayout) + implementation(libs.androidx.hilt.navigation.compose) + implementation(libs.hilt.android) + ksp(libs.hilt.compiler) + implementation(libs.gson) + implementation(libs.androidx.lifecycle.runtimeCompose) + implementation(libs.androidx.lifecycle.viewModelCompose) } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 58c25fe..e262997 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - - + xmlns:tools="http://schemas.android.com/tools"> - - - - + + + + - - - - + + + + diff --git a/app/src/main/assets/stock.json b/app/src/main/assets/stock.json new file mode 100644 index 0000000..a0d1e52 --- /dev/null +++ b/app/src/main/assets/stock.json @@ -0,0 +1,394 @@ +{ + "stocks": [{"name":"Advaxis, Inc.","value":199640373,"oldValue":86537921,"type":"Health Care"}, + {"name":"Archer-Daniels-Midland Company","value":118224608,"oldValue":6896093,"type":"Consumer Non-Durables"}, + {"name":"Pacific Coast Oil Trust","value":4022741,"oldValue":1692467,"type":"Energy"}, + {"name":"Nivalis Therapeutics, Inc.","value":17279659,"oldValue":9946606,"type":"Health Care"}, + {"name":"Capstead Mortgage Corporation","value":13939520,"oldValue":7498583,"type":"Consumer Services"}, + {"name":"Duke Realty Corporation","value":13201896,"oldValue":1755210,"type":"Consumer Services"}, + {"name":"SCIENCE APPLICATIONS INTERNATIONAL CORPORATION","value":6547811,"oldValue":4752354,"type":"Technology"}, + {"name":"Copart, Inc.","value":18685744,"oldValue":2930791,"type":"Consumer Durables"}, + {"name":"Zynga Inc.","value":7471188,"oldValue":4546621,"type":"Technology"}, + {"name":"Yulong Eco-Materials Limited","value":10203080,"oldValue":538147,"type":"Capital Goods"}, + {"name":"ClubCorp Holdings, Inc.","value":19800595,"oldValue":8295976,"type":"Consumer Services"}, + {"name":"AdvanSix Inc.","value":137583181,"oldValue":9486303,"type":"Basic Industries"}, + {"name":"Modern Media Acquisition Corp.","value":6497238,"oldValue":8825924,"type":"Finance"}, + {"name":"Global Indemnity Limited","value":2716458,"oldValue":9978237,"type":"Finance"}, + {"name":"Westrock Company","value":2757892,"oldValue":827856,"type":"Consumer Durables"}, + {"name":"Vivint Solar, Inc.","value":1619095,"oldValue":6793124,"type":"Capital Goods"}, + {"name":"The Priceline Group Inc. ","value":13999079,"oldValue":757383,"type":"Miscellaneous"}, + {"name":"Hawaiian Holdings, Inc.","value":8398507,"oldValue":4998514,"type":"Transportation"}, + {"name":"KKR & Co. L.P.","value":18327944,"oldValue":1447116,"type":"Finance"}, + {"name":"TOP Ships Inc.","value":2851201,"oldValue":8614942,"type":"Transportation"}, + {"name":"Premier Financial Bancorp, Inc.","value":6696347,"oldValue":2819621,"type":"Finance"}, + {"name":"ArcelorMittal","value":4936727,"oldValue":172489,"type":"Basic Industries"}, + {"name":"Cobalt International Energy, Inc.","value":1378969,"oldValue":7944153,"type":"Energy"}, + {"name":"PICO Holdings Inc.","value":6364949,"oldValue":5510803,"type":"Finance"}, + {"name":"OCI Partners LP","value":6094025,"oldValue":4338511,"type":"Basic Industries"}, + {"name":"Westar Energy, Inc.","value":823919,"oldValue":3841330,"type":"Public Utilities"}, + {"name":"Griffon Corporation","value":18130680,"oldValue":3035297,"type":"Capital Goods"}, + {"name":"Tronox Limited","value":8511067,"oldValue":6022453,"type":"Basic Industries"}, + {"name":"Agios Pharmaceuticals, Inc.","value":1622381,"oldValue":4544247,"type":"Health Care"}, + {"name":"Conduent Incorporated","value":7051310,"oldValue":1205165,"type":"Miscellaneous"}, + {"name":"PhotoMedex, Inc.","value":1566736,"oldValue":7148772,"type":"Health Care"}, + {"name":"Alliance MMA, Inc.","value":13152600,"oldValue":2847483,"type":"Consumer Services"}, + {"name":"American Financial Group, Inc.","value":5762291,"oldValue":5196626,"type":"Finance"}, + {"name":"CoBiz Financial Inc.","value":10075537,"oldValue":5368632,"type":"Finance"}, + {"name":"SLM Corporation","value":1415363,"oldValue":2056228,"type":"Finance"}, + {"name":"Prudential Bancorp, Inc.","value":17896463,"oldValue":1363421,"type":"Finance"}, + {"name":"Colfax Corporation","value":18838844,"oldValue":6838967,"type":"Capital Goods"}, + {"name":"National Presto Industries, Inc.","value":3956926,"oldValue":5444596,"type":"Capital Goods"}, + {"name":"MarketAxess Holdings, Inc.","value":18958614,"oldValue":8786581,"type":"Finance"}, + {"name":"Potlatch Corporation","value":18230112,"oldValue":783812,"type":"Consumer Services"}, + {"name":"Commercial Metals Company","value":12710909,"oldValue":9729212,"type":"Basic Industries"}, + {"name":"AllianceBernstein Holding L.P.","value":9589591,"oldValue":554712,"type":"Finance"}, + {"name":"Dynatronics Corporation","value":13378778,"oldValue":1137103,"type":"Health Care"}, + {"name":"Advanced Semiconductor Engineering, Inc.","value":15555492,"oldValue":6752334,"type":"Technology"}, + {"name":"Children's Place, Inc. (The)","value":8194952,"oldValue":8302831,"type":"Consumer Services"}, + {"name":"Red Lion Hotels Corporation","value":7063486,"oldValue":306833,"type":"Consumer Services"}, + {"name":"Guaranty Federal Bancshares, Inc.","value":11045363,"oldValue":1217322,"type":"Finance"}, + {"name":"Public Storage","value":18589842,"oldValue":4351914,"type":"Consumer Services"}, + {"name":"Supernus Pharmaceuticals, Inc.","value":13873602,"oldValue":6624086,"type":"Health Care"}, + {"name":"Mannatech, Incorporated","value":1639336,"oldValue":500557,"type":"Consumer Durables"}, + {"name":"Kimball International, Inc.","value":6083150,"oldValue":3254842,"type":"Consumer Durables"}, + {"name":"Independent Bank Corporation","value":10446686,"oldValue":3022603,"type":"Finance"}, + {"name":"Rice Midstream Partners LP","value":11180419,"oldValue":7882162,"type":"Public Utilities"}, + {"name":"Function(x) Inc.","value":8609829,"oldValue":2476288,"type":"Technology"}, + {"name":"Westmoreland Coal Company","value":3642184,"oldValue":1348687,"type":"Energy"}, + {"name":"Beasley Broadcast Group, Inc.","value":9728115,"oldValue":9677656,"type":"Consumer Services"}, + {"name":"Qumu Corporation","value":7984479,"oldValue":5865138,"type":"Technology"}, + {"name":"Arbutus Biopharma Corporation","value":4431046,"oldValue":4861727,"type":"Health Care"}, + {"name":"ECA Marcellus Trust I","value":73915345,"oldValue":19597,"type":"Energy"}, + {"name":"The Trade Desk, Inc.","value":15840891,"oldValue":9080557,"type":"Technology"}, + {"name":"Benitec Biopharma Limited","value":9558204,"oldValue":7954037,"type":"Health Care"}, + {"name":"Mitcham Industries, Inc.","value":19292907,"oldValue":1442638,"type":"Technology"}, + {"name":"Ark Restaurants Corp.","value":5994539,"oldValue":9472194,"type":"Consumer Services"}, + {"name":"Endurance International Group Holdings, Inc.","value":18544483,"oldValue":5236369,"type":"Technology"}, + {"name":"Enbridge Inc","value":17933330,"oldValue":9458561,"type":"Energy"}, + {"name":"Neogen Corporation","value":12735343,"oldValue":7290535,"type":"Health Care"}, + {"name":"First United Corporation","value":75337151,"oldValue":2481526,"type":"Finance"}, + {"name":"Resolute Energy Corporation","value":1229880,"oldValue":5250502,"type":"Energy"}, + {"name":"TJX Companies, Inc. (The)","value":10339511,"oldValue":566881,"type":"Consumer Services"}, + {"name":"Univar Inc.","value":12882588,"oldValue":4899967,"type":"Consumer Durables"}, + {"name":"Imperva, Inc.","value":9733332,"oldValue":8427940,"type":"Technology"}, + {"name":"Huntington Bancshares Incorporated","value":4878946,"oldValue":8799067,"type":"Finance"}, + {"name":"Kona Grill, Inc.","value":9196164,"oldValue":6231611,"type":"Consumer Services"}, + {"name":"Bankwell Financial Group, Inc.","value":15616536,"oldValue":2276846,"type":"Finance"}, + {"name":"Heritage Insurance Holdings, Inc.","value":17630573,"oldValue":1588635,"type":"Finance"}, + {"name":"First Financial Bankshares, Inc.","value":8689195,"oldValue":7663457,"type":"Finance"}, + {"name":"Monarch Casino & Resort, Inc.","value":11906268,"oldValue":5796904,"type":"Consumer Services"}, + {"name":"Jones Energy, Inc.","value":1403864,"oldValue":4951133,"type":"Energy"}, + {"name":"Aptose Biosciences, Inc.","value":18590609,"oldValue":9682346,"type":"Health Care"}, + {"name":"RLJ Lodging Trust","value":14178098,"oldValue":1485768,"type":"Consumer Services"}, + {"name":"Waters Corporation","value":11194724,"oldValue":6097865,"type":"Capital Goods"}, + {"name":"500.com Limited","value":6032472,"oldValue":2213509,"type":"Consumer Services"}, + {"name":"Aldeyra Therapeutics, Inc.","value":386906,"oldValue":5200017,"type":"Health Care"}, + {"name":"Molson Coors Brewing Company","value":15004408,"oldValue":4434611,"type":"Consumer Non-Durables"}, + {"name":"Franklin Covey Company","value":16553960,"oldValue":6713267,"type":"Consumer Services"}, + {"name":"Ooma, Inc.","value":12062577,"oldValue":7690301,"type":"Technology"}, + {"name":"Celsion Corporation","value":11251641,"oldValue":7826084,"type":"Health Care"}, + {"name":"Ominto, Inc.","value":5059531,"oldValue":9613772,"type":"Miscellaneous"}, + {"name":"Twitter, Inc.","value":7774026,"oldValue":1687568,"type":"Technology"}, + {"name":"Investar Holding Corporation","value":4600720,"oldValue":6074633,"type":"Finance"}, + {"name":"Ares Commercial Real Estate Corporation","value":10001603,"oldValue":7991652,"type":"Consumer Services"}, + {"name":"Acacia Communications, Inc.","value":11602055,"oldValue":3394619,"type":"Technology"}, + {"name":"Editas Medicine, Inc.","value":9714174,"oldValue":2664839,"type":"Health Care"}, + {"name":"Primero Mining Corp","value":2092701,"oldValue":6788784,"type":"Basic Industries"}, + {"name":"Anixter International Inc.","value":1378993,"oldValue":4876209,"type":"Consumer Non-Durables"}, + {"name":"Regis Corporation","value":14195760,"oldValue":3345875,"type":"Consumer Services"}, + {"name":"Werner Enterprises, Inc.","value":19925667,"oldValue":3512561,"type":"Transportation"}, + {"name":"Cabela's Inc","value":6721299,"oldValue":3811468,"type":"Consumer Services"}, + {"name":"Genesco Inc.","value":16842738,"oldValue":1180848,"type":"Consumer Services"}, + {"name":"Kennedy-Wilson Holdings Inc.","value":9680695,"oldValue":2456572,"type":"Finance"}, + {"name":"LiNiu Technology Group","value":11699102,"oldValue":8774605,"type":"Consumer Services"}, + {"name":"Maxim Integrated Products, Inc.","value":19821167,"oldValue":4228381,"type":"Technology"}, + {"name":"Tallgrass Energy Partners, LP","value":14856393,"oldValue":3015487,"type":"Public Utilities"}, + {"name":"Liberty Media Corporation","value":8449112,"oldValue":1492911,"type":"Consumer Services"}, + {"name":"Southern Company (The)","value":13887274,"oldValue":8130348,"type":"Public Utilities"}, + {"name":"Moleculin Biotech, Inc.","value":11287247,"oldValue":2915139,"type":"Health Care"}, + {"name":"Atlantica Yield plc","value":4346080,"oldValue":1438620,"type":"Public Utilities"}, + {"name":"Ferrari N.V.","value":12165430,"oldValue":6290994,"type":"Capital Goods"}, + {"name":"Alcobra Ltd.","value":12422094,"oldValue":7726927,"type":"Health Care"}, + {"name":"HCI Group, Inc.","value":6204063,"oldValue":8656062,"type":"Finance"}, + {"name":"Modern Media Acquisition Corp.","value":6915810,"oldValue":1753216,"type":"Finance"}, + {"name":"K2M Group Holdings, Inc.","value":5538316,"oldValue":8693679,"type":"Health Care"}, + {"name":"BiondVax Pharmaceuticals Ltd.","value":11206759,"oldValue":2563008,"type":"Health Care"}, + {"name":"TOP Ships Inc.","value":1706122,"oldValue":797677,"type":"Transportation"}, + {"name":"Penn National Gaming, Inc.","value":786535,"oldValue":2925881,"type":"Consumer Services"}, + {"name":"OM Asset Management plc","value":7540939,"oldValue":6794884,"type":"Finance"}, + {"name":"Eastman Kodak Company","value":13976953,"oldValue":7149123,"type":"Miscellaneous"}, + {"name":"G. Willi-Food International, Ltd.","value":5786784,"oldValue":2134817,"type":"Consumer Non-Durables"}, + {"name":"Guaranty Bancshares, Inc.","value":10452251,"oldValue":6129466,"type":"Finance"}, + {"name":"Essex Property Trust, Inc.","value":811194,"oldValue":2849859,"type":"Consumer Services"}, + {"name":"Tenneco Inc.","value":13727481,"oldValue":5836301,"type":"Capital Goods"}, + {"name":"Independent Bank Corporation","value":18220777,"oldValue":7986780,"type":"Finance"}, + {"name":"Golden Ocean Group Limited","value":9123980,"oldValue":3045538,"type":"Consumer Services"}, + {"name":"Eversource Energy","value":16784535,"oldValue":4020723,"type":"Public Utilities"}, + {"name":"Civista Bancshares, Inc. ","value":15246104,"oldValue":7857653,"type":"Finance"}, + {"name":"Cyclacel Pharmaceuticals, Inc.","value":9528923,"oldValue":7530165,"type":"Health Care"}, + {"name":"Geo Group Inc (The)","value":16978992,"oldValue":3649526,"type":"Consumer Services"}, + {"name":"Nova Lifestyle, Inc","value":19538015,"oldValue":2779559,"type":"Consumer Durables"}, + {"name":"EQT GP Holdings, LP","value":14338231,"oldValue":7520718,"type":"Public Utilities"}, + {"name":"Wal-Mart Stores, Inc.","value":7623896,"oldValue":7816219,"type":"Consumer Services"}, + {"name":"Liberty Interactive Corporation","value":13919421,"oldValue":3101064,"type":"Consumer Services"}, + {"name":"ePlus inc.","value":11178183,"oldValue":5921480,"type":"Technology"}, + {"name":"AcelRx Pharmaceuticals, Inc.","value":12603770,"oldValue":7456125,"type":"Health Care"}, + {"name":"iFresh Inc.","value":9271644,"oldValue":485425,"type":"Consumer Services"}, + {"name":"Jazz Pharmaceuticals plc","value":19021653,"oldValue":7705575,"type":"Health Care"}, + {"name":"Lockheed Martin Corporation","value":9427824,"oldValue":3912696,"type":"Capital Goods"}, + {"name":"United Security Bancshares","value":5275078,"oldValue":5327974,"type":"Finance"}, + {"name":"Northfield Bancorp, Inc.","value":13120213,"oldValue":653074,"type":"Finance"}, + {"name":"Kearny Financial","value":1232797,"oldValue":8572885,"type":"Finance"}, + {"name":"Tesco Corporation","value":8959104,"oldValue":1762735,"type":"Energy"}, + {"name":"The AES Corporation","value":84637,"oldValue":1530165,"type":"Basic Industries"}, + {"name":"ICF International, Inc.","value":12130634,"oldValue":3946549,"type":"Consumer Services"}, + {"name":"Helix Energy Solutions Group, Inc.","value":14251828,"oldValue":1857204,"type":"Energy"}, + {"name":"Entellus Medical, Inc.","value":3400613,"oldValue":782169,"type":"Health Care"}, + {"name":"ProPetro Holding Corp.","value":4982687,"oldValue":5546733,"type":"Energy"}, + {"name":"Dollar Tree, Inc.","value":1343606,"oldValue":8135386,"type":"Consumer Services"}, + {"name":"Genesee & Wyoming, Inc.","value":17895115,"oldValue":8570570,"type":"Transportation"}, + {"name":"VelocityShares Daily 2x VIX Short-Term ETN","value":12941318,"oldValue":2333439,"type":"Finance"}, + {"name":"Onconova Therapeutics, Inc.","value":2489669,"oldValue":6216568,"type":"Health Care"}, + {"name":"Dorchester Minerals, L.P.","value":2596197,"oldValue":1223634,"type":"Energy"}, + {"name":"B. Riley Financial, Inc.","value":12203351,"oldValue":5985418,"type":"Miscellaneous"}, + {"name":"The AES Corporation","value":3985667,"oldValue":7383067,"type":"Basic Industries"}, + {"name":"Cempra, Inc.","value":2717771,"oldValue":9320345,"type":"Health Care"}, + {"name":"Advanced Emissions Solutions, Inc.","value":10184351,"oldValue":6574979,"type":"Basic Industries"}, + {"name":"International Seaways, Inc.","value":5468925,"oldValue":8323533,"type":"Consumer Services"}, + {"name":"Finisar Corporation","value":9861741,"oldValue":9181323,"type":"Technology"}, + {"name":"SMART Global Holdings, Inc.","value":18179723,"oldValue":6817629,"type":"Technology"}, + {"name":"China Cord Blood Corporation","value":18998655,"oldValue":1770264,"type":"Finance"}, + {"name":"Norfolk Souther Corporation","value":3593097,"oldValue":9696157,"type":"Transportation"}, + {"name":"WESCO International, Inc.","value":1587262,"oldValue":6909536,"type":"Consumer Non-Durables"}, + {"name":"Surgery Partners, Inc.","value":1012442360,"oldValue":7806582,"type":"Health Care"}, + {"name":"Ramco-Gershenson Properties Trust","value":5116436,"oldValue":8895143,"type":"Consumer Services"}, + {"name":"Liberty Media Corporation","value":29628681,"oldValue":6325281,"type":"Consumer Services"}, + {"name":"EQT GP Holdings, LP","value":9154908,"oldValue":6072269,"type":"Public Utilities"}, + {"name":"Live Ventures Incorporated","value":6520917,"oldValue":5982074,"type":"Technology"}, + {"name":"The York Water Company","value":15713740,"oldValue":6412959,"type":"Public Utilities"}, + {"name":"Selective Insurance Group, Inc.","value":19345273,"oldValue":4703157,"type":"Finance"}, + {"name":"American Public Education, Inc.","value":6253269,"oldValue":7790784,"type":"Consumer Services"}, + {"name":"Noble Corporation","value":9745456,"oldValue":7923953,"type":"Energy"}, + {"name":"Weingarten Realty Investors","value":975542,"oldValue":8713571,"type":"Consumer Services"}, + {"name":"Omnicell, Inc.","value":10103136,"oldValue":7705927,"type":"Technology"}, + {"name":"Eaton Vance Corporation","value":8396300,"oldValue":9647749,"type":"Finance"}, + {"name":"Panera Bread Company","value":6496540,"oldValue":3977497,"type":"Consumer Services"}, + {"name":"Walker & Dunlop, Inc.","value":19730478,"oldValue":2655641,"type":"Finance"}, + {"name":"GDS Holdings Limited","value":5641832,"oldValue":4547956,"type":"Technology"}, + {"name":"Deere & Company","value":2050809,"oldValue":6227778,"type":"Capital Goods"}, + {"name":"Highway Holdings Limited","value":19247092,"oldValue":2436636,"type":"Capital Goods"}, + {"name":"Heritage Commerce Corp","value":8360485,"oldValue":197815,"type":"Finance"}, + {"name":"National General Holdings Corp","value":11881820,"oldValue":234680,"type":"Finance"}, + {"name":"EMCORE Corporation","value":17620631,"oldValue":9318670,"type":"Technology"}, + {"name":"HMS Holdings Corp","value":11897373,"oldValue":9036363,"type":"Miscellaneous"}, + {"name":"Arista Networks, Inc.","value":5706007,"oldValue":483122,"type":"Technology"}, + {"name":"XPO Logistics, Inc.","value":7940181,"oldValue":2274434,"type":"Consumer Services"}, + {"name":"Star Gas Partners, L.P.","value":11822196,"oldValue":1143660,"type":"Consumer Services"}, + {"name":"DelMar Pharmaceuticals, Inc.","value":10213104,"oldValue":1563335,"type":"Health Care"}, + {"name":"Liberty Global plc","value":3623955,"oldValue":3142925,"type":"Consumer Services"}, + {"name":"Wheeler Real Estate Investment Trust, Inc.","value":8631334,"oldValue":992544,"type":"Consumer Services"}, + {"name":"Mattel, Inc.","value":2406583,"oldValue":1875420,"type":"Consumer Non-Durables"}, + {"name":"Energy XXI Gulf Coast, Inc.","value":5215837,"oldValue":5241232,"type":"Energy"}, + {"name":"Modern Media Acquisition Corp.","value":6363825,"oldValue":439620,"type":"Finance"}, + {"name":"Nutanix, Inc.","value":12187134,"oldValue":4184730,"type":"Technology"}, + {"name":"IES Holdings, Inc.","value":11578541,"oldValue":6698631,"type":"Capital Goods"}, + {"name":"NewStar Financial, Inc.","value":3664459,"oldValue":1656798,"type":"Finance"}, + {"name":"Capstead Mortgage Corporation","value":15297850,"oldValue":4652803,"type":"Consumer Services"}, + {"name":"Lion Biotechnologies, Inc.","value":12509465,"oldValue":6467946,"type":"Health Care"}, + {"name":"Oconee Federal Financial Corp.","value":5801651,"oldValue":4332440,"type":"Finance"}, + {"name":"VeriSign, Inc.","value":8916716,"oldValue":7531011,"type":"Technology"}, + {"name":"American Equity Investment Life Holding Company","value":17275253,"oldValue":7167391,"type":"Finance"}, + {"name":"NeuroMetrix, Inc.","value":15761963,"oldValue":4385628,"type":"Health Care"}, + {"name":"Lilis Energy, Inc.","value":15164743,"oldValue":1315870,"type":"Energy"}, + {"name":"Reading International Inc","value":3357746,"oldValue":3235209,"type":"Consumer Services"}, + {"name":"Semtech Corporation","value":14379750,"oldValue":3438076,"type":"Technology"}, + {"name":"Fibria Celulose S.A.","value":12466101,"oldValue":9294358,"type":"Basic Industries"}, + {"name":"Peabody Energy Corporation","value":10070581,"oldValue":5665063,"type":"Energy"}, + {"name":"OraSure Technologies, Inc.","value":1435578,"oldValue":5018780,"type":"Health Care"}, + {"name":"Live Nation Entertainment, Inc.","value":564369,"oldValue":9546784,"type":"Consumer Services"}, + {"name":"Five Prime Therapeutics, Inc.","value":16551456,"oldValue":1739930,"type":"Health Care"}, + {"name":"Interlink Electronics, Inc.","value":9189241,"oldValue":1098262,"type":"Technology"}, + {"name":"BioCryst Pharmaceuticals, Inc.","value":9610024,"oldValue":2731849,"type":"Health Care"}, + {"name":"Park Electrochemical Corporation","value":909869,"oldValue":6650084,"type":"Technology"}, + {"name":"Nordson Corporation","value":16479586,"oldValue":2748287,"type":"Capital Goods"}, + {"name":"NexPoint Residential Trust, Inc.","value":4138771,"oldValue":4964761,"type":"Consumer Services"}, + {"name":"DHT Holdings, Inc.","value":15145531,"oldValue":7312667,"type":"Transportation"}, + {"name":"Q2 Holdings, Inc.","value":688719,"oldValue":2434127,"type":"Technology"}, + {"name":"Hebron Technology Co., Ltd.","value":13933081,"oldValue":1110195,"type":"Capital Goods"}, + {"name":"Lennar Corporation","value":4424996,"oldValue":3314300,"type":"Basic Industries"}, + {"name":"Expedia, Inc.","value":11176223,"oldValue":6797754,"type":"Consumer Services"}, + {"name":"Belmond Ltd.","value":18119189,"oldValue":3927528,"type":"Consumer Services"}, + {"name":"WashingtonFirst Bankshares Inc","value":4729777,"oldValue":8068486,"type":"Finance"}, + {"name":"Ryman Hospitality Properties, Inc.","value":14256463,"oldValue":925217,"type":"Consumer Services"}, + {"name":"Coupa Software Incorporated","value":4581708,"oldValue":4633603,"type":"Technology"}, + {"name":"Capitol Acquisition Corp. III","value":10175787,"oldValue":724101,"type":"Finance"}, + {"name":"Two Harbors Investments Corp","value":4682471,"oldValue":1143585,"type":"Consumer Services"}, + {"name":"Arlington Asset Investment Corp","value":3580342,"oldValue":6406374,"type":"Finance"}, + {"name":"FORM Holdings Corp.","value":2779556,"oldValue":3215323,"type":"Miscellaneous"}, + {"name":"Kimbell Royalty Partners","value":3710436,"oldValue":8271129,"type":"Energy"}, + {"name":"CenterState Banks, Inc.","value":19741207,"oldValue":4321648,"type":"Finance"}, + {"name":"Pepsico, Inc.","value":2862552,"oldValue":7644806,"type":"Consumer Non-Durables"}, + {"name":"Colfax Corporation","value":6695865,"oldValue":5872119,"type":"Capital Goods"}, + {"name":"ContraFect Corporation","value":18800111,"oldValue":1161890,"type":"Health Care"}, + {"name":"Ingevity Corporation","value":4123841,"oldValue":3107896,"type":"Basic Industries"}, + {"name":"Intelsat S.A.","value":14357725,"oldValue":7174659,"type":"Consumer Services"}, + {"name":"Mylan N.V.","value":14171011,"oldValue":3859818,"type":"Health Care"}, + {"name":"Colony Starwood Homes","value":16032374,"oldValue":9730898,"type":"Consumer Services"}, + {"name":"DMC Global Inc.","value":18742462,"oldValue":9676907,"type":"Capital Goods"}, + {"name":"ChinaNet Online Holdings, Inc.","value":11343019,"oldValue":296214,"type":"Technology"}, + {"name":"Universal Electronics Inc.","value":5795774,"oldValue":7598915,"type":"Consumer Non-Durables"}, + {"name":"Rosetta Genomics Ltd.","value":10059579,"oldValue":6484144,"type":"Health Care"}, + {"name":"CRA International,Inc.","value":8394861,"oldValue":3332509,"type":"Miscellaneous"}, + {"name":"Allegion plc","value":16717720,"oldValue":1971578,"type":"Consumer Services"}, + {"name":"J P Morgan Chase & Co","value":5061136,"oldValue":4096184,"type":"Finance"}, + {"name":"Applied Genetic Technologies Corporation","value":13015738,"oldValue":4104455,"type":"Health Care"}, + {"name":"Universal Stainless & Alloy Products, Inc.","value":11605370,"oldValue":378974,"type":"Basic Industries"}, + {"name":"Shiloh Industries, Inc.","value":13876888,"oldValue":7359271,"type":"Capital Goods"}, + {"name":"National Beverage Corp.","value":17873323,"oldValue":975688,"type":"Consumer Non-Durables"}, + {"name":"St. Joe Company (The)","value":17510379,"oldValue":5834750,"type":"Consumer Services"}, + {"name":"iPass Inc.","value":299421,"oldValue":9588916,"type":"Technology"}, + {"name":"Live Oak Bancshares, Inc.","value":9488211,"oldValue":3694665,"type":"Finance"}, + {"name":"Optical Cable Corporation","value":9597389,"oldValue":1843842,"type":"Basic Industries"}, + {"name":"American Axle & Manufacturing Holdings, Inc.","value":18176157,"oldValue":6569926,"type":"Capital Goods"}, + {"name":"Andina Acquisition Corp. II","value":10871679,"oldValue":2692095,"type":"Finance"}, + {"name":"Dominion Energy, Inc.","value":706781,"oldValue":2639871,"type":"Public Utilities"}, + {"name":"Prestige Brand Holdings, Inc.","value":19431157,"oldValue":6013254,"type":"Health Care"}, + {"name":"Aehr Test Systems","value":2321427,"oldValue":7999884,"type":"Capital Goods"}, + {"name":"Banner Corporation","value":3433768,"oldValue":5731174,"type":"Finance"}, + {"name":"Global Medical REIT Inc.","value":3709364,"oldValue":9278845,"type":"Consumer Services"}, + {"name":"Scorpio Tankers Inc.","value":4986586,"oldValue":6731919,"type":"Transportation"}, + {"name":"Actuant Corporation","value":8047996,"oldValue":6180357,"type":"Technology"}, + {"name":"QAD Inc.","value":10084227,"oldValue":8542132,"type":"Technology"}, + {"name":"Plains All American Pipeline, L.P.","value":18840787,"oldValue":5907006,"type":"Energy"}, + {"name":"Alexander's, Inc.","value":8449384,"oldValue":8056956,"type":"Consumer Services"}, + {"name":"Expeditors International of Washington, Inc.","value":8647043,"oldValue":7442559,"type":"Transportation"}, + {"name":"Grupo Supervielle S.A.","value":16596008,"oldValue":8393370,"type":"Finance"}, + {"name":"Provident Bancorp, Inc.","value":18257521,"oldValue":475458,"type":"Finance"}, + {"name":"Splunk Inc.","value":8452675,"oldValue":4101920,"type":"Technology"}, + {"name":"Dynegy Inc.","value":2570864,"oldValue":3331025,"type":"Public Utilities"}, + {"name":"Hunter Maritime Acquisition Corp.","value":11699016,"oldValue":6591456,"type":"Transportation"}, + {"name":"The AES Corporation","value":6454934,"oldValue":5892344,"type":"Basic Industries"}, + {"name":"Equity Commonwealth","value":1591577,"oldValue":8143375,"type":"Consumer Services"}, + {"name":"Pure Cycle Corporation","value":10491312,"oldValue":8043042,"type":"Public Utilities"}, + {"name":"Voya Financial, Inc.","value":19687099,"oldValue":8723455,"type":"Finance"}, + {"name":"CoreCivic, Inc.","value":8662324,"oldValue":673403,"type":"Consumer Services"}, + {"name":"Bruker Corporation","value":6056234,"oldValue":5955920,"type":"Capital Goods"}, + {"name":"MGM Growth Properties LLC","value":415036,"oldValue":6360950,"type":"Consumer Services"}, + {"name":"Potbelly Corporation","value":9659209,"oldValue":4349349,"type":"Consumer Services"}, + {"name":"Modern Media Acquisition Corp.","value":8327227,"oldValue":990264,"type":"Finance"}, + {"name":"Discover Financial Services","value":12174260,"oldValue":780671,"type":"Finance"}, + {"name":"Intellipharmaceutics International Inc.","value":16577327,"oldValue":7323470,"type":"Health Care"}, + {"name":"Nokia Corporation","value":18368749,"oldValue":2303066,"type":"Technology"}, + {"name":"United Therapeutics Corporation","value":10246967,"oldValue":1550179,"type":"Health Care"}, + {"name":"ChemoCentryx, Inc.","value":17524043,"oldValue":2233567,"type":"Health Care"}, + {"name":"aTyr Pharma, Inc.","value":18651837,"oldValue":5107766,"type":"Health Care"}, + {"name":"Monogram Residential Trust, Inc.","value":17506602,"oldValue":5636921,"type":"Consumer Services"}, + {"name":"Destination XL Group, Inc.","value":7936098,"oldValue":7264993,"type":"Consumer Services"}, + {"name":"Landmark Bancorp Inc.","value":3100231,"oldValue":8368591,"type":"Finance"}, + {"name":"WEX Inc.","value":2394543,"oldValue":6217169,"type":"Miscellaneous"}, + {"name":"WPP plc","value":2477743,"oldValue":9816044,"type":"Technology"}, + {"name":"Rentech, Inc.","value":13831917,"oldValue":5996949,"type":"Basic Industries"}, + {"name":"Gardner Denver Holdings, Inc.","value":16217044,"oldValue":4176482,"type":"Technology"}, + {"name":"Syndax Pharmaceuticals, Inc.","value":11679747,"oldValue":9323038,"type":"Health Care"}, + {"name":"L.S. Starrett Company (The)","value":9352057,"oldValue":9215527,"type":"Capital Goods"}, + {"name":"Intellipharmaceutics International Inc.","value":7598874,"oldValue":7000041,"type":"Health Care"}, + {"name":"La Quinta Holdings Inc.","value":11727294,"oldValue":9943295,"type":"Consumer Services"}, + {"name":"Pebblebrook Hotel Trust","value":19967390,"oldValue":7292807,"type":"Consumer Services"}, + {"name":"Liberty Interactive Corporation","value":303301,"oldValue":8133390,"type":"Consumer Services"}, + {"name":"Repros Therapeutics Inc.","value":9721374,"oldValue":8061983,"type":"Health Care"}, + {"name":"Liberty Media Corporation","value":14414541,"oldValue":24483,"type":"Consumer Services"}, + {"name":"Holly Energy Partners, L.P.","value":941153,"oldValue":3299750,"type":"Energy"}, + {"name":"DURECT Corporation","value":2829445,"oldValue":9148713,"type":"Health Care"}, + {"name":"Immuron Limited","value":6631145,"oldValue":5884566,"type":"Health Care"}, + {"name":"Chanticleer Holdings, Inc.","value":14100176,"oldValue":4277100,"type":"Consumer Services"}, + {"name":"PrivateBancorp, Inc.","value":12236141,"oldValue":6955382,"type":"Finance"}, + {"name":"Luxottica Group, S.p.A.","value":19389469,"oldValue":8049714,"type":"Health Care"}, + {"name":"BlackRock, Inc.","value":7935180,"oldValue":2984525,"type":"Finance"}, + {"name":"Harmony Gold Mining Company Limited","value":5885377,"oldValue":6998726,"type":"Basic Industries"}, + {"name":"Aware, Inc.","value":13562830,"oldValue":5954079,"type":"Technology"}, + {"name":"Arch Capital Group Ltd.","value":13222665,"oldValue":2834996,"type":"Finance"}, + {"name":"Chesapeake Granite Wash Trust","value":5164954,"oldValue":5595176,"type":"Energy"}, + {"name":"Medigus Ltd.","value":1014048,"oldValue":5856702,"type":"Health Care"}, + {"name":"First Defiance Financial Corp.","value":14916567,"oldValue":1450953,"type":"Finance"}, + {"name":"Mellanox Technologies, Ltd.","value":10760632,"oldValue":1738037,"type":"Technology"}, + {"name":"Xerium Technologies, Inc.","value":10128196,"oldValue":2757341,"type":"Basic Industries"}, + {"name":"Archrock Partners, L.P.","value":10638160,"oldValue":9383923,"type":"Public Utilities"}, + {"name":"Travelzoo","value":12667340,"oldValue":105835,"type":"Technology"}, + {"name":"Old National Bancorp","value":1463960,"oldValue":9314365,"type":"Finance"}, + {"name":"Northern Trust Corporation","value":9507717,"oldValue":9215996,"type":"Finance"}, + {"name":"Bravo Brio Restaurant Group, Inc.","value":5591768,"oldValue":8676188,"type":"Consumer Services"}, + {"name":"Airgain, Inc.","value":17417704,"oldValue":8965320,"type":"Technology"}, + {"name":"Steel Partners Holdings LP","value":18092463,"oldValue":8016468,"type":"Capital Goods"}, + {"name":"Sigma Labs, Inc.","value":13182510,"oldValue":4052450,"type":"Consumer Durables"}, + {"name":"Loral Space and Communications, Inc.","value":5746659,"oldValue":7712022,"type":"Technology"}, + {"name":"City Office REIT, Inc.","value":11984876,"oldValue":6380127,"type":"Consumer Services"}, + {"name":"InnerWorkings, Inc.","value":16765153,"oldValue":5013458,"type":"Consumer Durables"}, + {"name":"Giga-tronics Incorporated","value":12993482,"oldValue":7354184,"type":"Capital Goods"}, + {"name":"Nabriva Therapeutics AG","value":1976522,"oldValue":9706089,"type":"Health Care"}, + {"name":"Becton, Dickinson and Company","value":18600843,"oldValue":451254,"type":"Health Care"}, + {"name":"Condor Hospitality Trust, Inc.","value":11693691,"oldValue":8769321,"type":"Consumer Services"}, + {"name":"Sarepta Therapeutics, Inc.","value":15440933,"oldValue":2083088,"type":"Health Care"}, + {"name":"Tocagen Inc.","value":3373407,"oldValue":8268902,"type":"Health Care"}, + {"name":"California Water Service Group Holding","value":13807835,"oldValue":408319,"type":"Public Utilities"}, + {"name":"Alexandria Real Estate Equities, Inc.","value":7771822,"oldValue":5929434,"type":"Consumer Services"}, + {"name":"Vericel Corporation","value":13079683,"oldValue":6041120,"type":"Health Care"}, + {"name":"Silver Run Acquisition Corporation II","value":12447746,"oldValue":786682,"type":"Finance"}, + {"name":"Plantronics, Inc.","value":4461217,"oldValue":1218052,"type":"Public Utilities"}, + {"name":"Alon USA Energy, Inc.","value":1326767,"oldValue":1804024,"type":"Energy"}, + {"name":"World Acceptance Corporation","value":26137,"oldValue":6710481,"type":"Finance"}, + {"name":"Connecture, Inc.","value":19511961,"oldValue":8347414,"type":"Technology"}, + {"name":"TravelCenters of America LLC","value":11613713,"oldValue":3562909,"type":"Consumer Durables"}, + {"name":"Enbridge Energy Management LLC","value":9082787,"oldValue":6707482,"type":"Energy"}, + {"name":"Antero Midstream GP LP","value":5298023,"oldValue":7679760,"type":"Public Utilities"}, + {"name":"iPath US Treasury 2-year Bull ETN","value":4263400,"oldValue":6515,"type":"Finance"}, + {"name":"Bio-Path Holdings, Inc.","value":5719699,"oldValue":5080662,"type":"Health Care"}, + {"name":"GGP Inc.","value":17886045,"oldValue":7927816,"type":"Consumer Services"}, + {"name":"Quantenna Communications, Inc.","value":14421802,"oldValue":8548048,"type":"Technology"}, + {"name":"American Homes 4 Rent","value":6365588,"oldValue":2515922,"type":"Consumer Services"}, + {"name":"Voyager Therapeutics, Inc.","value":3378313,"oldValue":838459,"type":"Health Care"}, + {"name":"Sears Hometown and Outlet Stores, Inc.","value":4073091,"oldValue":5445930,"type":"Consumer Services"}, + {"name":"Brookfield Infrastructure Partners LP","value":122392,"oldValue":8306440,"type":"Consumer Services"}, + {"name":"Canada Goose Holdings Inc.","value":16112197,"oldValue":6254719,"type":"Consumer Non-Durables"}, + {"name":"Penns Woods Bancorp, Inc.","value":8605774,"oldValue":7598459,"type":"Finance"}, + {"name":"PROS Holdings, Inc.","value":7604365,"oldValue":1743669,"type":"Technology"}, + {"name":"Analogic Corporation","value":7150641,"oldValue":8499821,"type":"Capital Goods"}, + {"name":"ARCA biopharma, Inc.","value":19151215,"oldValue":7335250,"type":"Health Care"}, + {"name":"Double Eagle Acquisition Corp.","value":7324455,"oldValue":3246095,"type":"Finance"}, + {"name":"NL Industries, Inc.","value":9864199,"oldValue":568913,"type":"Basic Industries"}, + {"name":"PCSB Financial Corporation","value":10525620,"oldValue":7562810,"type":"Finance"}, + {"name":"XG Technology, Inc","value":10573440,"oldValue":4339795,"type":"Consumer Durables"}, + {"name":"PrivateBancorp, Inc.","value":8248536,"oldValue":3638905,"type":"Finance"}, + {"name":"OneMain Holdings, Inc.","value":6806662,"oldValue":6545964,"type":"Finance"}, + {"name":"Convergys Corporation","value":15564226,"oldValue":1949811,"type":"Technology"}, + {"name":"PRA Group, Inc.","value":8266401,"oldValue":9130930,"type":"Finance"}, + {"name":"Pulmatrix, Inc.","value":13493086,"oldValue":5587730,"type":"Health Care"}, + {"name":"China Lending Corporation","value":1307444,"oldValue":4534226,"type":"Finance"}, + {"name":"Box, Inc.","value":9853198,"oldValue":6336972,"type":"Technology"}, + {"name":"J. Alexander's Holdings, Inc.","value":4598331,"oldValue":4257497,"type":"Consumer Services"}, + {"name":"Diamondback Energy, Inc.","value":5550513,"oldValue":9079701,"type":"Energy"}, + {"name":"Hunter Maritime Acquisition Corp.","value":18734144,"oldValue":1092039,"type":"Transportation"}, + {"name":"Patheon N.V.","value":16697492,"oldValue":1478992,"type":"Health Care"}, + {"name":"CEVA, Inc.","value":13070977,"oldValue":1801488,"type":"Technology"}, + {"name":"Incyte Corporation","value":724858,"oldValue":4358760,"type":"Health Care"}, + {"name":"Jensyn Acquistion Corp.","value":19553328,"oldValue":4653088,"type":"Finance"}, + {"name":"Companhia Paranaense de Energia (COPEL)","value":13063940,"oldValue":7707488,"type":"Public Utilities"}, + {"name":"Siliconware Precision Industries Company, Ltd.","value":4276321,"oldValue":1631487,"type":"Technology"}, + {"name":"Enterprise Products Partners L.P.","value":947451,"oldValue":8700133,"type":"Public Utilities"}, + {"name":"Tantech Holdings Ltd.","value":16785034,"oldValue":4754583,"type":"Basic Industries"}, + {"name":"Graham Corporation","value":11248104,"oldValue":8663662,"type":"Technology"}, + {"name":"Coach, Inc.","value":14079509,"oldValue":6723615,"type":"Consumer Non-Durables"}, + {"name":"AMC Networks Inc.","value":563703,"oldValue":7848970,"type":"Consumer Services"}, + {"name":"Xilinx, Inc.","value":17619072,"oldValue":3926712,"type":"Technology"}, + {"name":"Nexeo Solutions, Inc.","value":2130374,"oldValue":8401300,"type":"Consumer Durables"}, + {"name":"Frank's International N.V.","value":4094385,"oldValue":2457689,"type":"Energy"}, + {"name":"Bridgepoint Education, Inc.","value":12412764,"oldValue":2753004,"type":"Consumer Services"}, + {"name":"FormFactor, Inc.","value":13319243,"oldValue":2182928,"type":"Technology"}, + {"name":"America Movil, S.A.B. de C.V.","value":11145570,"oldValue":46362,"type":"Public Utilities"}, + {"name":"Ardelyx, Inc.","value":14097703,"oldValue":12814378,"type":"Health Care"}, + {"name":"Cars.com Inc.","value":18297170,"oldValue":2185918,"type":"Technology"}, + {"name":"CryoPort, Inc.","value":166812067,"oldValue":2927497,"type":"Transportation"}, + {"name":"Porter Bancorp, Inc.","value":1537261,"oldValue":8669072,"type":"Finance"}, + {"name":"Under Armour, Inc.","value":2316838,"oldValue":2359963,"type":"Consumer Non-Durables"}, + {"name":"Grupo Financiero Santander Mexico S.A. B. de C.V.","value":2339173,"oldValue":1420803,"type":"Finance"}, + {"name":"Alliance One International, Inc.","value":5554268,"oldValue":2507269,"type":"Consumer Services"}, + {"name":"Medley LLC","value":3631279,"oldValue":1601402,"type":"Finance"}] +} \ No newline at end of file diff --git a/app/src/main/kotlin/com/taewooyo/volcano/Colors.kt b/app/src/main/kotlin/com/taewooyo/volcano/Colors.kt index b9ea364..c34dce9 100644 --- a/app/src/main/kotlin/com/taewooyo/volcano/Colors.kt +++ b/app/src/main/kotlin/com/taewooyo/volcano/Colors.kt @@ -19,19 +19,12 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.toArgb internal fun getColor(percentage: Double): Int = when { - percentage < -30.0 -> Color(0xFFFCB9AA).toArgb() - percentage < -25.0 -> Color(0xFFFFDBCC).toArgb() - percentage < -20.0 -> Color(0xFFECEAE4).toArgb() - percentage < -15.0 -> Color(0xFFA2E1DB).toArgb() - percentage < -10.0 -> Color(0xFF55CBCD).toArgb() - percentage < -5.0 -> Color(0xFFABDEE6).toArgb() - percentage < 0.0 -> Color(0xFFCBAACB).toArgb() - percentage < 5.0 -> Color(0xFFE4AE9D).toArgb() - percentage < 10.0 -> Color(0xFFE1CCB6).toArgb() - percentage < 15.0 -> Color(0xFFF3B0C3).toArgb() - percentage < 20.0 -> Color(0xFF4b8f82).toArgb() - percentage < 25.0 -> Color(0xFFC08863).toArgb() - percentage < 30.0 -> Color(0xFF5AA08D).toArgb() - percentage < 35.0 -> Color(0xFFEF84C1).toArgb() + percentage < -30.0 -> Color(0xFF9a1f29).toArgb() + percentage < -20.0 -> Color(0xFFf23645).toArgb() + percentage < -10.0 -> Color(0xFFf77c80).toArgb() + percentage < 0.0 -> Color(0xFFc2c4cd).toArgb() + percentage < 10.0 -> Color(0xFF43bd7f).toArgb() + percentage < 20.0 -> Color(0xFF049950).toArgb() + percentage < 30.0 -> Color(0xFF076636).toArgb() else -> Color(0xFFFC9ABB).toArgb() } diff --git a/app/src/main/kotlin/com/taewooyo/volcano/Dummy.kt b/app/src/main/kotlin/com/taewooyo/volcano/Dummy.kt deleted file mode 100644 index 75a484b..0000000 --- a/app/src/main/kotlin/com/taewooyo/volcano/Dummy.kt +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (C) 2023 taewooyo - * - * 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.taewooyo.volcano - -internal enum class Type { - ENTERTAINMENT, - OTT, - SPORT, - E_SPORT, -} - -internal data class HotIssue( - val name: String, - val value: Double, - val oldValue: Double, - val type: Type, -) - -internal val dummyData = listOf( - HotIssue( - name = "BTS", - value = 26_949_643.0, - oldValue = 1_485_168.0, - type = Type.ENTERTAINMENT, - ), - HotIssue( - name = "Black Pink", - value = 17_700_899.0, - oldValue = -399_145.0, - type = Type.ENTERTAINMENT, - ), - HotIssue( - name = "NETFLIX", - value = 4_429_838.0, - oldValue = 354_443.0, - type = Type.OTT, - ), - HotIssue( - name = "Coupang Play", - value = 4230862.0, - oldValue = -2_676.0, - type = Type.OTT, - ), - HotIssue( - name = "TVING", - value = 3_732_224.0, - oldValue = 345_821.0, - type = Type.OTT, - ), - HotIssue( - name = "Wavve", - value = 3_332_059.0, - oldValue = 261_459.0, - type = Type.OTT, - ), - HotIssue( - name = "LOL", - value = 3_049_016.0, - oldValue = 264_996.0, - type = Type.E_SPORT, - ), - HotIssue( - name = "Valorant", - value = 2_186_082.0, - oldValue = 174_069.0, - type = Type.E_SPORT, - ), - HotIssue( - name = "Disney+", - value = 2_126_809.0, - oldValue = 202_675.0, - type = Type.OTT, - ), - HotIssue( - name = "G-Dragon", - value = 2_117_805.0, - oldValue = -22_035.0, - type = Type.ENTERTAINMENT, - ), - HotIssue( - name = "Overwatch", - value = 1_862_470.0, - oldValue = -377_952.0, - type = Type.E_SPORT, - ), - HotIssue( - name = "Son Heung min", - value = 1_709_232.0, - oldValue = 43_986.0, - type = Type.SPORT, - ), - HotIssue( - name = "Cristiano Ronaldo", - value = 1_582_054.0, - oldValue = 192_127.0, - type = Type.SPORT, - ), - HotIssue( - name = "Lionell Messi", - value = 1_417_387.0, - oldValue = 127_958.0, - type = Type.SPORT, - ), - HotIssue( - name = "Fortnite", - value = 1_092_748.0, - oldValue = 102_165.0, - type = Type.E_SPORT, - ), - HotIssue( - name = "Battle Ground", - value = 905_684.0, - oldValue = 98_450.0, - type = Type.E_SPORT, - ), -) diff --git a/app/src/main/kotlin/com/taewooyo/volcano/MainApplication.kt b/app/src/main/kotlin/com/taewooyo/volcano/MainApplication.kt new file mode 100644 index 0000000..8851507 --- /dev/null +++ b/app/src/main/kotlin/com/taewooyo/volcano/MainApplication.kt @@ -0,0 +1,7 @@ +package com.taewooyo.volcano + +import android.app.Application +import dagger.hilt.android.HiltAndroidApp + +@HiltAndroidApp +class MainApplication : Application() \ No newline at end of file diff --git a/app/src/main/kotlin/com/taewooyo/volcano/core/assets/AssetLoader.kt b/app/src/main/kotlin/com/taewooyo/volcano/core/assets/AssetLoader.kt new file mode 100644 index 0000000..e24f12f --- /dev/null +++ b/app/src/main/kotlin/com/taewooyo/volcano/core/assets/AssetLoader.kt @@ -0,0 +1,21 @@ +package com.taewooyo.volcano.core.assets + +import android.content.Context +import javax.inject.Inject + +class AssetLoader @Inject constructor(private val context: Context) { + fun getJsonString(fileName: String): String? { + return runCatching { + loadAsset(fileName) + }.getOrNull() + } + + private fun loadAsset(fileName: String): String { + return context.assets.open(fileName).use { inputStream -> + val size = inputStream.available() + val bytes = ByteArray(size) + inputStream.read(bytes) + String(bytes) + } + } +} \ No newline at end of file diff --git a/app/src/main/kotlin/com/taewooyo/volcano/core/assets/di/AssetModule.kt b/app/src/main/kotlin/com/taewooyo/volcano/core/assets/di/AssetModule.kt new file mode 100644 index 0000000..4ed549c --- /dev/null +++ b/app/src/main/kotlin/com/taewooyo/volcano/core/assets/di/AssetModule.kt @@ -0,0 +1,19 @@ +package com.taewooyo.volcano.core.assets.di + +import android.content.Context +import com.taewooyo.volcano.core.assets.AssetLoader +import dagger.Module +import dagger.Provides +import dagger.hilt.InstallIn +import dagger.hilt.android.qualifiers.ApplicationContext +import dagger.hilt.components.SingletonComponent +import javax.inject.Singleton + +@Module +@InstallIn(SingletonComponent::class) +internal object AssetModule { + + @Provides + @Singleton + fun provideAssetLoader(@ApplicationContext context: Context): AssetLoader = AssetLoader(context) +} \ No newline at end of file diff --git a/app/src/main/kotlin/com/taewooyo/volcano/core/data/di/DataModule.kt b/app/src/main/kotlin/com/taewooyo/volcano/core/data/di/DataModule.kt new file mode 100644 index 0000000..7e53624 --- /dev/null +++ b/app/src/main/kotlin/com/taewooyo/volcano/core/data/di/DataModule.kt @@ -0,0 +1,16 @@ +package com.taewooyo.volcano.core.data.di + +import com.taewooyo.volcano.core.data.stock.StockRepository +import com.taewooyo.volcano.core.data.stock.StockRepositoryImpl +import dagger.Binds +import dagger.Module +import dagger.hilt.InstallIn +import dagger.hilt.components.SingletonComponent + +@Module +@InstallIn(SingletonComponent::class) +internal interface DataModule { + + @Binds + fun bindsStockRepository(stockRepositoryImpl: StockRepositoryImpl): StockRepository +} \ No newline at end of file diff --git a/app/src/main/kotlin/com/taewooyo/volcano/core/data/stock/StockRepository.kt b/app/src/main/kotlin/com/taewooyo/volcano/core/data/stock/StockRepository.kt new file mode 100644 index 0000000..0f18af0 --- /dev/null +++ b/app/src/main/kotlin/com/taewooyo/volcano/core/data/stock/StockRepository.kt @@ -0,0 +1,9 @@ +package com.taewooyo.volcano.core.data.stock + +import com.taewooyo.volcano.core.model.Stocks +import kotlinx.coroutines.flow.Flow + +interface StockRepository { + + fun fetchStockList(): Stocks? +} \ No newline at end of file diff --git a/app/src/main/kotlin/com/taewooyo/volcano/core/data/stock/StockRepositoryImpl.kt b/app/src/main/kotlin/com/taewooyo/volcano/core/data/stock/StockRepositoryImpl.kt new file mode 100644 index 0000000..039b64e --- /dev/null +++ b/app/src/main/kotlin/com/taewooyo/volcano/core/data/stock/StockRepositoryImpl.kt @@ -0,0 +1,17 @@ +package com.taewooyo.volcano.core.data.stock + +import com.google.gson.Gson +import com.taewooyo.volcano.core.assets.AssetLoader +import com.taewooyo.volcano.core.model.Stocks +import javax.inject.Inject + +class StockRepositoryImpl @Inject constructor( + private val assetLoader: AssetLoader +) : StockRepository { + override fun fetchStockList(): Stocks? { + val gson = Gson() + return assetLoader.getJsonString("stock.json")?.let { jsonString -> + gson.fromJson(jsonString, Stocks::class.java) + } + } +} \ No newline at end of file diff --git a/app/src/main/kotlin/com/taewooyo/volcano/core/model/StockItem.kt b/app/src/main/kotlin/com/taewooyo/volcano/core/model/StockItem.kt new file mode 100644 index 0000000..ae092aa --- /dev/null +++ b/app/src/main/kotlin/com/taewooyo/volcano/core/model/StockItem.kt @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2023 taewooyo + * + * 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.taewooyo.volcano.core.model + +data class Stocks( + val stocks: List +) + +data class StockItem( + val name: String, + val value: Double, + val oldValue: Double, + val type: String, +) \ No newline at end of file diff --git a/app/src/main/kotlin/com/taewooyo/volcano/MainActivity.kt b/app/src/main/kotlin/com/taewooyo/volcano/ui/MainActivity.kt similarity index 57% rename from app/src/main/kotlin/com/taewooyo/volcano/MainActivity.kt rename to app/src/main/kotlin/com/taewooyo/volcano/ui/MainActivity.kt index f20cee6..0689235 100644 --- a/app/src/main/kotlin/com/taewooyo/volcano/MainActivity.kt +++ b/app/src/main/kotlin/com/taewooyo/volcano/ui/MainActivity.kt @@ -13,49 +13,63 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.taewooyo.volcano +package com.taewooyo.volcano.ui +import android.os.Build import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent +import androidx.activity.viewModels +import androidx.annotation.RequiresApi import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.runtime.collectAsState import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import com.taewooyo.volcano.compose.Volcano +import com.taewooyo.volcano.getColor import com.taewooyo.volcano.volcano.VolcanoBuilder import com.taewooyo.volcano.volcano.root +import dagger.hilt.android.AndroidEntryPoint +@AndroidEntryPoint class MainActivity : ComponentActivity() { + + private val viewModel: MainViewModel by viewModels() + + @RequiresApi(Build.VERSION_CODES.M) override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - val totalValue = dummyData.sumOf { it.value } - val dividedDummyData = dummyData.groupBy { it.type } - val volcano = root { - name { null } - weight { totalValue } - sections { - dividedDummyData.toList().forEach { (type, items) -> - section { - name { type.name } - weight { items.sumOf { it.value } } - elements { - items.forEach { hotIssue -> - element { - name { hotIssue.name } - weight { hotIssue.value } - percentage { (hotIssue.oldValue / hotIssue.value) * 100 } - color { getColor((hotIssue.oldValue / hotIssue.value) * 100).toLong() } + setContent { + val stocks = viewModel.stocks.collectAsState().value + val total = stocks.stocks.sumOf { it.value } + val sector = stocks.stocks.groupBy { it.type } + + val volcano = root { + name { null } + weight { total } + sections { + sector.toList().forEach { (type, items) -> + section { + name { type } + weight { items.sumOf { it.value } } + elements { + items.forEach { stock -> + element { + name { stock.name } + weight { stock.value } + percentage { (stock.oldValue / stock.value) * 100 } + color { getColor((stock.oldValue / stock.value) * 100).toLong() } + } } } } } } } - } - setContent { + Box(modifier = Modifier.fillMaxSize()) { Volcano( modifier = Modifier, @@ -64,7 +78,7 @@ class MainActivity : ComponentActivity() { onClickElement = {}, selectedBorderColor = Color.Black, selectedItem = null, - showRateText = false, + showRateText = true, ) } } diff --git a/app/src/main/kotlin/com/taewooyo/volcano/ui/MainViewModel.kt b/app/src/main/kotlin/com/taewooyo/volcano/ui/MainViewModel.kt new file mode 100644 index 0000000..e63deeb --- /dev/null +++ b/app/src/main/kotlin/com/taewooyo/volcano/ui/MainViewModel.kt @@ -0,0 +1,32 @@ +package com.taewooyo.volcano.ui + +import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import com.taewooyo.volcano.core.data.stock.StockRepository +import com.taewooyo.volcano.core.model.Stocks +import dagger.hilt.android.lifecycle.HiltViewModel +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.update +import kotlinx.coroutines.launch +import javax.inject.Inject + +@HiltViewModel +class MainViewModel @Inject constructor( + private val stockRepository: StockRepository +) : ViewModel() { + + private val _stocks: MutableStateFlow = MutableStateFlow(value = Stocks(emptyList())) + val stocks = _stocks.asStateFlow() + + init { + viewModelScope.launch { + val stocks = stockRepository.fetchStockList() + _stocks.update { state -> + stocks?.let { + state.copy(stocks = it.stocks) + } ?: state + } + } + } +} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index ed1579a..7d62298 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,6 +8,8 @@ plugins { alias(libs.plugins.spotless) alias(libs.plugins.dokka) alias(libs.plugins.kotlin.binary.compatibility) + alias(libs.plugins.ksp) apply false + alias(libs.plugins.hilt.plugin) apply false } subprojects { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index deeb64f..aa94e22 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,10 +1,11 @@ [versions] -agp = "8.3.2" -kotlin = "1.9.10" -dokka = "1.9.20" +agp = "8.2.2" +kotlin = "1.9.23" +dokka = "1.9.10" +ksp = "1.9.23-1.0.20" kotlinBinaryCompatibility = "0.13.2" -androidxComposeBom = "2023.10.01" -androidxComposeCompiler = "1.5.3" +androidxComposeBom = "2024.04.00" +androidxComposeCompiler = "1.5.11" jvmTarget = "11" androidxComposeConstraintLayout = "1.0.1" androidxMaterial = "1.11.0" @@ -16,16 +17,21 @@ androidxAnnotation = "1.7.1" androidxTest = "1.5.2" spotless = "6.21.0" nexusPlugin = "0.27.0" +androidxHiltNavigationCompose = "1.2.0" +hilt = "2.51.1" +gson = "2.10.1" [plugins] android-application = { id = "com.android.application", version.ref = "agp" } android-library = { id = "com.android.library", version.ref = "agp" } -android-test = {id = "com.android.test", version.ref = "agp"} +android-test = { id = "com.android.test", version.ref = "agp" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-binary-compatibility = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlinBinaryCompatibility" } spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } nexus-plugin = { id = "com.vanniktech.maven.publish", version.ref = "nexusPlugin" } dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } +hilt-plugin = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } +ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } [libraries] androidx-material = { module = "com.google.android.material:material", version.ref = "androidxMaterial" } @@ -42,7 +48,15 @@ androidx-compose-material = { group = "androidx.compose.material", name = "mater androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "androidxActivity" } androidx-compose-foundation = { group = "androidx.compose.foundation", name = "foundation" } androidx-compose-runtime = { group = "androidx.compose.runtime", name = "runtime" } +androidx-lifecycle-runtimeCompose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "androidxLifecycle" } +androidx-lifecycle-viewModelCompose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "androidxLifecycle" } androidx-compose-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout-compose", version.ref = "androidxComposeConstraintLayout" } +hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" } +hilt-compiler = { module = "com.google.dagger:hilt-compiler", version.ref = "hilt" } +hilt-testing = { module = "com.google.dagger:hilt-android-testing", version.ref = "hilt" } +androidx-hilt-navigation-compose = { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "androidxHiltNavigationCompose" } +gson = { module = "com.google.code.gson:gson", version.ref = "gson" } + # unit test androidx-test-runner = { group = "androidx.test", name = "runner", version.ref = "androidxTest" } diff --git a/volcano-compose/src/main/kotlin/com/taewooyo/volcano/compose/Volcano.kt b/volcano-compose/src/main/kotlin/com/taewooyo/volcano/compose/Volcano.kt index 0e56321..69983d5 100644 --- a/volcano-compose/src/main/kotlin/com/taewooyo/volcano/compose/Volcano.kt +++ b/volcano-compose/src/main/kotlin/com/taewooyo/volcano/compose/Volcano.kt @@ -16,6 +16,7 @@ package com.taewooyo.volcano.compose import androidx.compose.animation.animateContentSize +import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.border import androidx.compose.foundation.clickable @@ -47,6 +48,8 @@ import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.layout.Layout import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.font.FontStyle import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow @@ -213,7 +216,6 @@ private fun Element( 0.5.dp, if (item.name == selectedItem?.name) selectedBorderColor else borderColor, ) - .clip(RoundedCornerShape(5.dp)) .background(Color(item.color)), ) { val boxWidth = constraints.maxWidth diff --git a/volcano/src/main/kotlin/com/taewooyo/volcano/squarified/SquarifiedMeasurer.kt b/volcano/src/main/kotlin/com/taewooyo/volcano/squarified/SquarifiedMeasurer.kt index c821778..3d363e1 100644 --- a/volcano/src/main/kotlin/com/taewooyo/volcano/squarified/SquarifiedMeasurer.kt +++ b/volcano/src/main/kotlin/com/taewooyo/volcano/squarified/SquarifiedMeasurer.kt @@ -32,11 +32,11 @@ class SquarifiedMeasurer : Measurer { private var elements = mutableListOf() // 차트의 요소 리스트 /** - * 차트의 요소들 사이즈 측정 및 설정하는 함수 - * @param [values] 비중 값 - * @param [width] 차트의 가로 길이 - * @param [height] 차트의 세로 길이 - * @return 노드들의 가로, 세로, 오프셋 리스트 반환 + * Functions to measure and set the size of elements in a chart. + * @param [values] specific gravity value + * @param [width] horizontal length of the chart + * @param [height] vertical length of the chart + * @return Returns a list of horizontal, vertical, and offset nodes */ override fun measureNodes(values: List, width: Int, height: Int): List { setSizeAndValues(values, width.toDouble(), height.toDouble()) @@ -44,10 +44,10 @@ class SquarifiedMeasurer : Measurer { } /** - * 차트의 사이즈 설정 및 비중 설정하는 함수 - * @param [values] 비중 값 - * @param [width] 차트의 가로 길이 - * @param [height] 차트의 세로 길이 + * Function to set the size and proportion of the chart + * @param [values] specific gravity value + * @param [width] horizontal length of the chart + * @param [height] vertical length of the chart */ private fun setSizeAndValues(values: List, width: Double, height: Double) { this.width = width @@ -67,8 +67,8 @@ class SquarifiedMeasurer : Measurer { } /** - * 차트의 노드들의 좌표 및 크기를 반환해주는 함수 - * @return 차트맵 배치 알고리즘을 통해 좌표 및 크기가 설정된 차트 노드 리스트를 반환 + * Function that returns the coordinates and sizes of the nodes in the chart + * @return Returns a list of chart nodes with coordinates and sizes set through the chart map placement algorithm */ private fun measureNodes(): List { val treemapNodes: MutableList = ArrayList() @@ -90,9 +90,9 @@ class SquarifiedMeasurer : Measurer { } /** - * @param [elements] 가중치 - * @param [row] 현재 행 - * @param [w] 그려질 수 있는 영역의 남은 값. + * @param [elements] specific gravity value + * @param [row] current row + * @param [w] The remaining value of the drawable area */ private fun squarify( elements: List, @@ -121,27 +121,27 @@ class SquarifiedMeasurer : Measurer { } /** - * @return 사용 가능한 영역에서 너비와 높이의 작은 값 반환 + * @return Return small values of width and height from available area */ private fun minimumSide(): Double = min(heightLeft, widthLeft) /** - * 2개의 Double 타입의 정확한 비교를 위한 함수 + * Function for accurate comparison of two Double types */ private fun isEqual(source: Double, target: Double): Boolean = abs(source - target) < 0.00001 /** - * 레이아웃 변경 + * Change layout */ private fun changeLayout() { layoutOrientation = layoutOrientation.toggle(layoutOrientation) } /** - * - w값에 따른 최악의 형태(면적 비율)를 계산. - * - 반환 값이 커질수록 w 값에서 더 최악의 형태. - * - 반환 값이 작을수록 w 값에서 더 좋은 형태. - * @return w 값과 요소들의 면적을 고려하여 최악의 값을 반환. + * - Calculate the worst shape (area ratio) according to the w value. + * - The larger the return value, the worse the worst form for the w value. + * - The smaller the return value, the better the shape for the w value + * @return Returns the worst value considering the w value and the area of ​​the elements */ private fun worst(ch: List, w: Double): Double { if (ch.isEmpty()) { @@ -165,7 +165,7 @@ class SquarifiedMeasurer : Measurer { } /** - * squarify로 인해 그릴 준비가 완료되면 노드들의 좌표를 구하는 함수 + * A function that calculates the coordinates of nodes when preparation for drawing is completed with squarify */ private fun layoutRow(row: List, w: Double) { var totalArea = 0.0 @@ -215,8 +215,8 @@ class SquarifiedMeasurer : Measurer { } /** - * 화면에 맞게 비중 값을 재 설정하는 함수 - * @param [elements] 비중이 담긴 차트 요소 리스트 + * Function to reset the specific gravity value to fit the screen + * @param [elements] List of chart elements with proportions */ private fun scaleArea(elements: List) { val areaGiven = width * height