replaces keyword diagram by graph