views:

488

answers:

1

I have an XML file that I have parsed and have put the information I want into several NSArray objects. I want to be able to draw them in a QuartzView (anything better?) to visualize the data. The arrays should all hypothetically contain the same amount of info. I want one array to represent the x axis and another the y. It took long enough to get quartz composer to bind to my array code, but I can only get it to draw either one sphere with unique coordinates or a sphere for every index with same. So basically I need help making a plot in QC based off of array data. The code looks something like this:

- (IBAction) setup:(id)sender {
    BlastParser *bp = [[BlastParser alloc] init];
    NSString *hit_idString = @".//hit_id";
    NSString *evalueString = @".//Hsp_evalue";
    NSString *hsp_align_lenString = @".//Hsp_align-len";

    NSArray *hit_id = [bp getArrayForNode:hit_idString];
    NSArray *evalue = [bp getArrayForNode:evalueString];
    NSArray *hsp_align_len = [bp getArrayForNode:hsp_align_lenString];

    NSLog(@"nodes: %@", Hsp_align_len);
    int i;
    for (i = 0; i < [evalue count]; ++i){
        [qcView setValue:[NSNumber numberWithInt:i] forInputKey:@"iter"];
    }
}

Thanks in advance.

A: 

It sounds like it might be easier to just use a regular NSView and draw your shapes (in the view's drawRect: method) with something like:

int radius = 4;
NSBezierPath *circle = [NSBezierPath bezierPathWithOvalInRect:NSMakeRect(xPos-radius, yPos-radius, 2*radius, 2*radius)];
[circle fill];

Where xPos and yPos are the coordinates of the point you want to draw.

However, maybe there is some other reason you want to use Quartz Composer?

Dan Messing
Thanks Dan. I have taken that suggestion and although I am not quite there yet it seems to be a much easier route.
Rick