Commit Graph

87 Commits

Author SHA1 Message Date
Greg Landrum
77a44f667e Cleanup a bunch of compiler warnings (#1696)
* remove a bunch of compiler warnings

* remove some more warnings on windows (there are still plenty to go...)
2018-03-23 14:11:07 +01:00
Greg Landrum
56b472ef97 Support continuous highlighting in drawMolecules(). (#1579)
Add a fillHighlights option to DrawOptions
2017-09-22 07:25:17 +02:00
Greg Landrum
9af90524a4 Provide support for color palettes in MolDraw2D (#1546)
* first steps towards flexible colour palettes

* add B&W palette and a test for it

* add python support;
this is, once again, not the best API due to the inability to auto-translate boost::tuples at this point

* more palette control from python

* rename some of the swig-wrapped types to make them more consistent

* handle palettes that do not have a default value
2017-09-08 10:52:01 +02:00
Greg Landrum
5741d37c39 Support drawing reactions from C++ (#1444)
* expose and test GetDrawCoords()

* very basics are working; still loads of work to do

* very basics are working; still loads of work to do

* symbols and arrows kind of work

* switch to Nadine's approach for drawing
needs more work (like arrows and pluses) but already is not too bad

* better, but agents still to close to arrow and arrow is too short

* add a test for rxns without agents

* fix picking of cid;
drawing reactions without reactants or without products should in theory now work, but additional work is needed to get the arrows to show up

* make reactions without reactants or without products draw properly

* tweak vshift a bit; would be good to have a better solution to this

* do not draw H2O as OH2

* add option to use highlighting to show atom maps

* highlight bonds too

* cleanup

* add drawReaction to the python wrapper

* docs

* remove some printing

* fix (for real) the drawing of degree zero atoms

* ensure ring finding gets done; add some more tests

* add some SMARTS-based tests; these do not work

* improve reactant highlighting in rxn drawing

- define default colors for highlighting of reactants, atom or bonds
in the drawing options
- make highlighting colors customizable through the API

* rename to test4 in prep for merge

* temporarily disable test4 since it does not work anyway

* fix some kekulization problems

* fix YA unicode problem

* remove a stupid typo
2017-07-05 14:25:31 -04:00
Greg Landrum
09d7314aed Feat/github1325 (#1347)
* Fixes #1325

* add a smart PRECONDITION
2017-03-08 23:17:29 -05:00
Greg Landrum
527b6cd922 Fixes #1322 (#1342) 2017-03-04 12:33:34 -05:00
Greg Landrum
0eb42b4605 Resolve #1323 (#1327)
* works, but needs more testing

* progress

* at least a modicum of testing
2017-02-22 07:23:47 -05:00
Greg Landrum
f196567182 Fixes #1271 (#1272)
* Fixes #1271

* add a comment or two

* fix single-atom molecules too

* add a test for grid drawing too

* simplification of the special cases; no need to make things so complex
2017-01-22 13:49:09 -05:00
Greg Landrum
dc7c9b6f31 Provide SVG output from the cartridge (#1109)
* a bit of header cleanup

* Fixes #1106

* First pass, basics.
Still need tests and handling of parameters.

* initial pass at including JSON parsing of options (not complete)

* handle errors while parsing json instead of just crashing the server

* updated (and working) JSON configuration

* first drawing tests

* document the new function

* it helps to save before committing
2016-10-21 17:05:59 -04:00
Greg Landrum
65f3cab86a Fixes #1056 (#1101) 2016-10-14 11:36:46 -04:00
Greg Landrum
98e3e941da Merge branch 'feat/draw_multiple_mols' of https://github.com/greglandrum/rdkit into greglandrum-feat/draw_multiple_mols 2016-09-14 16:42:48 -07:00
Greg Landrum
23fce87073 Draw crossed bonds (#1052)
* remove dead code

* Draw crossed bonds
2016-09-14 11:01:50 -04:00
Greg Landrum
eb2b81c1e2 handle null molecules 2016-08-31 20:13:45 +02:00
Greg Landrum
29d9251f93 first pass at drawing a grid 2016-08-31 05:01:50 +02:00
Greg Landrum
435a07a30e better control over scaling 2016-08-30 17:56:34 +02:00
Greg Landrum
1eb2c4924a grid drawing now working 2016-08-30 15:18:32 +02:00
Greg Landrum
8b6ecda0cd first pass at multiple panels 2016-08-30 14:41:56 +02:00
Greg Landrum
ad79aff187 more or less works 2016-08-30 13:45:36 +02:00
Greg Landrum
c045e9f88b passes all drawing tests 2016-08-30 11:04:29 +02:00
Greg Landrum
2dab4d434d does not yet work 2016-08-30 10:45:59 +02:00
Paolo Tosco
87b69a7d82 Added the option to label deuterium and tritium as D and T (#1011)
* - added the option to label deuterium and tritium as D and T
  to the C++ and Python drawing code

* - added test for deuterium/tritium labels
2016-08-19 04:51:04 +02:00
Greg Landrum
ddb13ecc16 Add an initial version of wavy bonds (#1014)
* Add an initial version of wavy bonds
Used for attachment points and unknown stereochem
This is not a perfect implementation, but is a decent place to start
Currently only supports SVG and Cairo canvases.

* code review cleanup
2016-08-16 08:06:27 +02:00
Greg Landrum
91212a4eb3 A variety of drawing-related changes (#986)
* Fixes #982
also changes bond-wedging algorithm to favor lighter non-ring bonds

* prefer wedging bonds to lower-degree atoms

* Fixes #983

* small fixes
- Fix a problem where a chiral atom is selected to draw a wedge to instead of a ring atom
- Fix a problem where two calls to PrepareMolForDrawing() led to two wedged bonds from an atom.

* Fixes #985

This isn't the most satisfying solution (the wedged bonds are sometimes a bit too large), but it gives reasonable results on the test cases I've tried.
2016-07-25 17:28:41 -04:00
Greg Landrum
0705af7a41 Fixes #953 (#954) 2016-06-24 07:42:21 -04:00
Greg Landrum
8c3d28da67 Fixes #860 2016-04-14 15:50:36 +02:00
Greg Landrum
b9751b687c post-pull cleanup on #853
Suggested in the comments post-merge
2016-04-12 02:58:23 +02:00
Greg Landrum
33489e70e3 Fixes #852
* Fixes #852

The test added is the usual thing for the drawing code: produce some files for visual inspection.

* limit the number of lines in a short wedge
2016-04-11 13:40:44 -04:00
Greg Landrum
0b70879ba9 make Hs black instead of gray 2016-03-21 14:56:53 +01:00
Greg Landrum
77444f948f fix a copy-paste error 2016-03-10 04:47:13 +01:00
Greg Landrum
2b3cedb8c8 fix a problem with the double bonds in mol files from marvin 2016-03-06 05:42:17 +01:00
Greg Landrum
c3ebd2c414 remove some duplicated code 2016-03-06 05:04:15 +01:00
Greg Landrum
a7d163471d make it easier to draw a molecule with a legend. Note: should clean up the backend code some... there is way too much duplication here 2016-03-05 16:38:07 +01:00
Greg Landrum
19ac08b799 fixing getAtomCoords() necessitates a fix to the legend placement 2016-03-05 16:26:18 +01:00
Greg Landrum
3a5d1bd6c8 fix getAtomCoords() and add a test for it 2016-03-05 16:22:02 +01:00
Greg Landrum
5eeb468368 move the legends back to the bottom 2016-03-05 16:01:50 +01:00
Greg Landrum
c423e6d990 allow control over the offset for multiple bonds 2016-03-05 15:44:57 +01:00
Greg Landrum
db5f8d43aa Add the ability to do legends on molecules in MolDraw2D
Relevant to #424
2016-03-05 15:44:55 +01:00
Greg Landrum
dd03cb0971 make wedged bonds 50% wider 2016-03-05 15:39:55 +01:00
Greg Landrum
94f602e54e fix a y origin problem
add an additional test
2016-03-03 16:10:54 +01:00
Greg Landrum
e5e8e2bfef now Qt works too 2016-03-03 13:49:33 +01:00
Greg Landrum
3d0d9bc5ba switch to an enum for the draw type;
Cairo and SVG build
Cairo looks mostly ok
SVG is still a disaster
2016-03-03 10:32:05 +01:00
Greg Landrum
dac6eef2d8 basics ok: the molecule now renders properly. Text is still not right 2016-03-03 08:55:05 +01:00
Greg Landrum
5a7acf3e6c merge master 2016-03-03 04:40:12 +01:00
Greg Landrum
27a267bd6c Fixes #781 2016-02-17 16:19:01 +01:00
Greg Landrum
c187536865 this is not even close to being right 2016-02-15 16:51:41 +01:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Greg Landrum
e37296d7c7 post review 2015-11-14 08:08:14 +01:00
Brian Kelley
daa7e62258 Fixes signed conversion issues (use rdcast) 2015-10-18 15:16:38 -04:00
Brian Kelley
5f59333a56 Silences unused parameters 2015-10-18 14:02:29 -04:00
Greg Landrum
9314b3d39a support not clearing the background in drawings or explicitly setting the color;
fixes #587
2015-09-17 05:15:59 +02:00