The Road to KDE 4: Kalzium and KmPlot

Since not all of the development for KDE 4 is in base technologies, this week features two of applications from the KDE-Edu team: Kalzium, a feature-filled
chemistry reference tool, and KmPlot, a powerful equation graphing and visualization program. Read on for the details.

These educational tools have received a lot of work for KDE 4. In particular, Kalzium and KmPlot developments are happening at an amazing rate.

Kalzium (the German word for Calcium) has been a part of KDE since version 3.1 and is now one of the most useful applications developed by the KDE-Edu team. Initially it was just a program that displayed the periodic table, alongside some useful numbers like atomic weights, boiling points, etc. It was later extended to include a lot of background information on the elements, and more detailed chemistry information (such as emission spectra) which made it a very useful chemistry reference.

In KDE 3.5.5 (which I used for these screenshots, even though 3.5.6 was released last week), Kalzium looks something like this when first loaded:

Click for fullsize.

You can see that the interface is pretty simple, and presents a lot of information. If you click on an element it brings up even more information on its properties.

The main user interface in KDE 4 does not look that different, except for the fact that Qt 4 introduces some appearance changes, and there are some more icons (some that haven't been drawn yet) in the toolbar. Here's a peek at Kalzium in the KDE 4 development series:

Click for fullsize.

So Kalzium is visually quite similar between versions at this point. However, the important thing to note in the KDE 4 screenshot is the tools menu. In KDE 3.5.5, this menu contains only Plot Data and Glossary.

Plot Data shows the elements plotted in a variety of useful ways, such as mass, radius, electronegativity, etc. while the Glossary shows definitions for many of the more common chemical terms. It is apparently missing the above mentioned electronegativity, so evidently there is still room for improvement here. Making improvements to the Glossary would be a great opportunity for a chemistry-inclined person to contribute to Kalzium in KDE 4 without having to be a programmer.

Anyway, back to the new tools. I'll focus on a few of the newly developed tools that will make Kalzium even more useful in KDE 4:

The isotope table will display a list of isotopes and their decay methods - as a geologist for example, it is important for me to know that Potassium-40 usually decays by electron capture.

The new equation solver is also quite useful, as seen in the following screenshot provided by Kalzium lead developer Carsten Niehaus:

You basically just punch in a chemical equation leaving letters in place of the numbers you are looking for, and it spits out a response. In high school chemistry, students are expected to be able to solve these sorts of equations manually, but like most equations, once you solve enough of them, it simply becomes tedious. This equation solver can save a lot of time for complex equations.

And finally, the most visible change to Kalzium is the inclusion of the Kalzium 3D work, which turns the program into a 3D molecule viewer. Initially, it was developed by the Kalzium developers for use in this application only, but some collaboration has since happened and it will now be using libavogadro a library jointly developed by the Kalzium and Avogadro developers.

According to the Kalzium developers work is progressing on porting the 3D modeller to use libavagadro, an effort led by Donald Curtis, providing a more general/powerful framework for rendering/manipulating molecules with Qt and OpenGL library. It is shared between Kalzium and Avogadro (and more). Avogadro is a much more advanced molecular modelling programs, useful for creating the actual molecule files, and doing quantum chemistry. Kalzium 3D will simply act as a viewer for files constructed using these programs.

Kalzium developer Benoît Jacob submits the following screenshot showing the 3D molecule viewer in action using the new Kalzium 3D functionality. This functionality is already SVN as this article goes to press, however work continues with libavogadro integration.

Click for fullsize.

Kalzium will likely ship with a library of common molecules ready to view provided by the BlueObelisk project. Thanks to the OpenBabel library, it should also be able to open molecule files in a huge variety of formats (I counted 62 file formats that it already supports).

On to our next KDE-Edu feature: KmPlot. For a while already, this application has had the ability to plot regular functions, parametric functions, and polar functions, as well as show derivatives (or regular functions) and a few other goodies. It has been useful as an equation visualization tool, but the interface has been awkward, with many little cluttered dialogs to fight with.

Below is KmPlot in KDE 3.5.5 with it's default settings, and three functions plotted, one of each type:

The dialogs used to plot these equations look something like this, except there is one unique dialog for each type of plot:

Here's a quick look of the new KmPlot interface with the same three functions plotted. No more dialogs to mess with, and the plots can be in shapes other than square! Plus Qt 4 gives everything a nice anti-aliased touch.

Click for fullsize.

KmPlot has received a huge amount of work, and should be one of the KDE 4's killer apps for students, engineers, and more. It plots differential equations now, has a new equation editor, and (as seen in the above screenshot) gives tips as to how to correct your equations.

The new equation editor is shown below with a differential equation being edited:

As you can see, it's much easier to enter an equation when you can design the functions in a nice syntax checking editor like this one. There is a lot more work going into KmPlot than I can describe in just this article, so if you are interested in more information, check out its development status page.

KDE-Edu is a growing project, with many great applications being developed for a wide variety of age groups. They will have support for Windows and Mac as well, thanks to the improved QT 4 and KDE 4 libraries, and should become more popular programs as a result. Since there is so much great work happening here, expect some other KDE-Edu applications to show up in future articles.


by Carsten Niehaus (not verified)

Actually, most people don't know that. Also, Kalzium is not X-specific but also works on Mac and Windows where you usually don't have a X-Server.

by Kjetil Kilhavn (not verified)

AltGr + i --- cool! I didn't know that.
The things one can learn from reading the .news!

by Dan Leinir Turt... (not verified)

alt-gr... That's one of those keys that don't exist on all keyboard, right? at least i don't have one on my keyboard ;) (powerbook g4 - yes, i was pretty surprised to find out that key was missing too)

by Chani (not verified)

what is the "gr" in alt-gr? I don't think I've ever seen anything labelled gr on a standard keyboard.

by Anonymous Coward (not verified)

Sorry, yes, I'm just referring to the onscreen output, not the keyboard input. :)

by Carsten Niehaus (not verified)

In the first version we used the Unicode-version. But on many systems there are fonts installed which do NOT ship that symbol. Instead of a nice symbol they got a square.

That is now one year ago and the situation still didn't change. We could force certain fonts or test if the symbol is included in the font (and if not use '->' as a fallback).

Are you willing to send me a patch or are you just trolling?

by Eimai (not verified)

If you want to look for code that tests if a glyph is in the font, take a look at the password box that now tests if a certain black circle is in the font and otherwise display a * IIRC.

But please do something like this, the "->" just looks clumsy, especially because the "-" and ">" don't vertically align properly. You should allow that users enter "->" of course.

And btw, situation has changed a bit since last year, since many distros have switched from bitstream vera to dejavu as their default font, and the latter has the arrow symbol. Also, testing a bit with Qt4 shows that the font substitution algorithms have improved since Qt3. So if one font has the arrows, it should be able to display them. If you don't have DejaVu, it should be able to pick it up from Arial from MS corefonts for example (that's at least how Qt4 does it here when I uninstall DejaVu). I would safely say that most users have at least one font with the arrows installed these days, and in that case Qt4 will show one for whatever font you have picked.

by ....... (not verified)

Doesnt the solver itself matter a bit more than a unicode detail ?

Now for the unicode, many linux distributions provide a default font where the arrow does not exist.

by Aceler (not verified)

Will KmPlot formulas and images can be integrated in Kword?

by - (not verified)

Why must all geeky apps consist of nothing but fluorescent colors? We left the EGA color palette ages ago, so please make an effort not to burn out eyes. Simply turning down the saturation slides might help.? And no, I'm not some artistic type: I'm a programmer and I have a sense of color, simply because I paid attention to it. Do the same, and you'll find people will suddenly not cringe when they see your presentation slides, graphs or flowcharts.

As for kmplot: I have to wonder why almost 2/3rds of the toolbar is dedicated to 3 buttons labeled "coordinate system I/II/III" when literally the only useful element is their icons. The huge buttons would just be as informative without a label (or if you have to add one, how about "Axes" ?), and would be best merged together in a single drop-down or horizontal button group. Or best: provide a simple "+" shaped diagram and let the user toggle each of the axes on or off by clicking them.

Seriously, take some cues from OS X's built-in Grapher application. It's tons easier to use, because it doesn't shove advanced features in your face if all you want to do is plot a graph. (toolbar hidden) (toolbar visible and in 3D mode)

It has a much simpler layout, and keeps complicated options (such as exact coordinate ranges) away from the main screen using inspectors (aka floating palettes). Graphing applications should make it trivial to make simple doodle graphs and not be too obsessed with exact measurements until you need them. The math entry is transparent... you type things like "e^x" "sin x" "1/x-1" but they get formatted and edited appropriately.

Generally speaking, I think you have a problem if you design a graphing application where only a small part of the window is actually *covered by the graph*. Wasn't KDE4 supposed to be much more usable?

by Troy Unrau (not verified)

The toolbar icons can/will change, nevermind the fact that you can disable text in the toolbars anyway. The function of those buttons just adjusts the viewport anyway, not really changing coordinate systems. The actual adjustment when you click the button is pretty slicks - the graph smoothly slides around in the viewport.

Regarding the last line, I resized the window to that point - which is much smaller than my screen. If I had maximized the program, the graph would occupy nearly 80% of the screen space. Just a function of reducing screenshot size for publishing.

Please keep in mind that this is a development version of the program, and that the features going in are still a work in progress. However, if you've ever used KmPlot from KDE 3.x, you'd already understand how much of a huge improvement this is.

And that's really the point of these articles, to show that there is progress happening for KDE 4. Release is still many months away - we probably won't even see a beta until summer, so things can still change greatly.

by Vigilant (not verified)

Someone teach this "programmer" what open software development is.

I'm just fed up with all this people whining and shooting at the developers everytime they show something new. Do you know what open development is? Do you think OSX's Grapher looked like that final version all the while they were developing it?.

The toolbar label issue is something talked about a thousand times already. IT IS NOT FINAL. KDE4 will have HCI guidelines (which are on the works) and we'll see how the usability theme pans out.

Why do this people come here whining all the time?. Or look at Zack's last couple of blog entries. Even when warns he was "just trying to do something visually funky" someone has to complain "and what is the usability case, exactly". Go get a life and stop whining. Ever heard what creativity is?

KDE4 UI has looked much like KDE3 all this time, it is still more than half a year away and developers are still getting the core libraries right. They haven't focused on looks at all yet.

Sorry -, whoever you are. Your first point was valid, but the rest...

by Lans (not verified)

I agree with many of you points. However, as other persons already mentioned, you could have expressed yourself better. The last comment is stupid.

If I were you I would talk to the developers and give suggestions. And not compliance.

by chris (not verified)

hi guys,

first of all, i'd like to say thanks for the great work on KDE-Edu. I'm a bioinformatics student at the University of Tuebingen and one of our professors is developing this program (library respectively) to view biological molecules (BALL-View) and to perform biochemical computations (BALL lib).

As it is using QT and it's GPL/LGPL I thought you might want to have a look at it:


by Benoit Jacob (not verified)

thanks for drawing our attention to this app, it looks impressive.

by Kjetil Kilhavn (not verified)

The old main window was probably a bit crowded, but the pendulum seems to have swung quite far the other way.

If the font size of the symbols can't be set by the user I suggest increasing it to the size from the 3.5 version.

Some people (teachers?) may also find it useful to have the mass available in the main window for all elements. Will the information that is displayed be configurable (hooray), or did you just decide it was too crowded (hoo)?