kivymd-extensions / akivymd Goto Github PK
View Code? Open in Web Editor NEWA Set of cool UI widgets for KivyMD
License: MIT License
A Set of cool UI widgets for KivyMD
License: MIT License
exposing the markup and text property(because it is a child of MDLabel
) of MDIcon
to allow the ease of use of custom icons in custom font files
I installed the module as written in the instructions, but it gives an error:
ModuleNotFoundError: No module named 'kivymd.components'
When I run the AKBarChart, the smallest value never plots.
from kivymd.app import MDApp
from kivy.lang.builder import Builder
from kivymd_extensions.akivymd.uix.charts import AKBarChart
KV = '''
#:import get_color_from_hex kivy.utils.get_color_from_hex
MDScreen:
MDBoxLayout:
orientation: 'vertical'
ScrollView:
MDBoxLayout:
id: layout
orientation: 'vertical'
spacing: 20
padding: 10
adaptive_height: True
AKBarChart:
size_hint_y: None
height: "280dp"
id: chart
labels: True
anim: False
label_size: 15
bars_radius: 0
# Customize the colors
# bars colors
bars_color: get_color_from_hex("#4CD6D7")
# background color
bg_color: get_color_from_hex("#363E41")
# line color
lines_color: get_color_from_hex("#363E41")
x_values: [1, 2, 3, 4]
y_values: [3, 4, 6, 8]
'''
class BarChartApp(MDApp):
def build(self):
return Builder.load_string(KV)
def on_start(self):
chart = self.root.ids.chart
# adding x labels
chart.x_labels = ['C', 'C++', 'Java', 'Python']
if name == 'main':
BarChartApp().run()
Add images to explain us this bug. Paste urls here.
Remove this section if no images here
Your text
from kivy.app import App
from kivy.lang import Builder
kv = """
Screen:
# KV-Code
"""
class MainApp(App):
def build(self):
self.root = Builder.load_string(kv)
if __name__ == '__main__':
MainApp().run()
Add images to explain us this bug. Paste urls here.
Remove this section if no images here
if ScrollView can be turned to a RecycleView, this will allow a faster dynamic widget update. Adding a widget dynamically in ScrollView wastes a lot of time and sometimes freezes the app. Using RecycleView will be more realstic
on_touch_move the disable swipe is checked:
def on_touch_move(self, touch):
pos = touch.pos
if not self._root.allow_swipe:
return False
[......]
but during on_touch_up event its not checked, this cause the user to click else where and the swipemenu is dismissed,
is this a bug or intended?
I want to create multiple AKBarCharts. But when I put them on a RecycleView
, the data displayed in each graph is incorrect.
from kivy.lang import Builder
from kivymd.app import MDApp
from kivy.factory import Factory as F
from kivy.uix.recycleview.views import RecycleDataViewBehavior
Builder.load_string("""
<Barchart@AKBarChart>
size_hint_y: None
height: dp(200)
x_values: root.x_values
y_values: root.y_values
label_size: sp(12)
bg_color: 202/255,202/255,202/255,1
bars_color: 128/255,0,0,1
labels_color: 0,0,0,1
<ScreenOne>:
RecycleView:
viewclass: 'Barchart'
data: root.data
RecycleBoxLayout:
size_hint: (1, None)
height: self.minimum_height
padding: dp(10)
spacing: dp(20)
orientation: 'vertical'
default_size_hint: 1, None
default_size: None, dp(200)
""")
data = [
{
'x_values': [i, i + 1, i + 2, i + 3],
'y_values': [10*i, 20*i, 30*i, 40*i],
'id': i,
} for i in range(9)
]
class ScreenOne(F.Screen):
data = data
class Barchart(RecycleDataViewBehavior, F.BoxLayout):
x_values = F.ListProperty([1, 2, 3, 4, 5])
y_values = F.ListProperty([1, 2, 3, 4, 5])
id = F.NumericProperty()
class MyApp(MDApp):
def build(self):
return ScreenOne()
MyApp().run()
When you run the app, the first three or four items will be displaying the correct data.
Once you scroll down/up, every item will be shuffled and then everything will be incorrect.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.